In our current setup with Visual Studio 2017
, we are working on two separate web projects that need to share some React
components built with TypeScript
. In addition, there are common JavaScript
and CSS
files that need to be shared. To achieve this, we have set up a Shared Project
in Visual Studio.
If you're curious about the distinction between a Shared Project and a Class Library in Visual Studio 2015, check out this resource.
Currently, the project consists of just one file containing the following information:
export const Types = {
Type1: '1',
Type2: '2',
Type3: '3'
}
During testing, I can reference it as follows for Visual Studio to locate the file:
import { Types} from '../../../2/Constants/Types'
However, when attempting to run webpack
, an error occurs:
TS6059: File '/2/Constants/Types.ts' is not under 'rootDir' '/1'. 'rootDir' is expected to contain all source files.