I have a Visual Studio project with a structure like so:
My tsconfig.json
looks like:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"outDir": "../wwwroot/"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
However, VS isn't compiling the app.ts
into the wwwroot
folder.
What am I missing?
Running tsc locally will compile the closest project defined by a tsconfig.json , you can compile a set of TypeScript files by passing in a glob of files you want.
The reason is that the default shell in visual studio code is powershell, which doesn't check the current directory. To change the default shell to command prompt, follow these steps. Open vscode and enter the shortcut ctrl + `.
Try adding "compileOnSave": true
to your tsconfig.json
:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"outDir": "../wwwroot/"
},
"exclude": [
"node_modules",
"wwwroot"
],
"compileOnSave": true
}
It should compile every time you save now.
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