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?
From within Visual Studio, Project > Properties > Build > ensure that the "Compile TypeScript on build" is checked:
Also, in your
tsconfig.json
you should specify arootDir
so that TypeScript knows where to look for*.ts
files it should compile:The details are called out on the TypeScript page here and here.
Don't forget to actually build it. It isn't a file watcher scenario.
Try adding
"compileOnSave": true
to yourtsconfig.json
:It should compile every time you save now.