title: Visual Studio -> Shared TypeScript Library -> TS6059 File '' is not under 'rootDir' ''. 'rootDir' is expected to contain all source files
body: <p>We are using <code>Visual Studio 2017</code> and have two separate web projects that are supposed to share some <code>React</code> components written in <code>TypeScript</code>. There can also be shared <code>JavaScript</code> files and <code>CSS</code> files. For this we have created a <code>Shared Project</code> in Visual Studio.</p>
  
  <p><a href="https://stackoverflow.com/questions/30634753/what-is-the-difference-between-a-shared-project-and-a-class-library-in-visual-st">What is the difference between a Shared Project and a Class Library in Visual Studio 2015?</a></p>
  
  <p>Right now the project only has a single file with this information.</p>
  
  <pre><code>export const Types = {
      Type1: '1',
      Type2: '2',
      Type3: '3'
  }
  </code></pre>
  
  <p>For testing I can reference it like this and Visual Studio will locate the file:</p>
  
  <pre><code>import { Types} from '../../../2/Constants/Types'
  </code></pre>
  
  <p>However when I then try to run <code>webpack</code> I get the following error:</p>
  
  <blockquote>
    <p>TS6059: File '/2/Constants/Types.ts' is not under
    'rootDir' '/1'. 'rootDir' is expected to contain all source
    files.</p>
  </blockquote>