I have created a ASP.NET 5 project which I use mainly for a front-end typescript application.
I'm using grunt and grunt-ts to do the compilation.
I have a 'src' folder where all my typescript files are contained
grunt-ts compiles everything in the 'src' folder and combines this to a single js file which is then put in the wwwroot folder. A typescript definition file is also generated and put in the wwwroot folder.
compiling with grunt/grunt-ts works flawlessly.
The problem: When the definition file exist in the wwwroot folder, the visual studio IDE starts giving me lots of 'Duplicate identifier' errors. This is of course because of the definition file.
Is there a way to make visual studio ignore the wwwroot folder (or any folder) for it's IDE/internal typescript compilation?
You want to add a tsconfig.json
file to the root of your project which contains the following:
{
"compilerOptions": {
"noImplicitAny": true,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": false,
"module": "commonjs",
"target": "es5"
},
"exclude": [
"bower_components",
"node_modules",
"wwwroot"
]
}
The tsconfig.json file is responsible for configuring TypeScript compilation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With