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