I have a few typescript files for my app myapp
in my Visual Studio 2017 ASP.NET project. I use a gulp task to generate the JS files, so I don't want the build or language service creating these JS and JS.MAP files.
This is how my TSCONFIG file look like:
{
"compileOnSave": false,
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"module": "system",
"types": [ "" ],
"lib": [
"es6",
"dom"
]
},
"include": [
"./myapp/**/*"
]
}
I tried the following:
I added the myapp
to the exclude
section of the tsconfig.js. Both the js and js.map are not generated at that time if I close Visual Studio and open again. But I see a lot of compilation errors.
I added <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
to the .csproj
file. I closed VS 2017, opened again and did a build. I see the JS and JS.MAP files.
I changed the BuildAction
property to none, but still see the JS and JS.MAP files
What should I do so the syntax check of the TS file will work but does not generate any JS and JS.MAP files?
If Visual Studio seems to be ignoring the noemit option in the tsconfig file, edit your project file. In the project file, go to the <PropertyGroup>
that contains the rest of the TypeScript options and add <TypeScriptNoEmit>True</TypeScriptNoEmit>
between that PropertyGroup's open and closing tags.
Try add "noEmit": true
in your tsconfig
. It should prevent the .js .js.map from generating.
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