I am trying to write a nodejs command line app with Typescript and I have the following tsconfig file:
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist"
},
"include": ["src/*.ts"]
}
When I use tsc
everything works as expected (*.js files appear in the dist folder).
However, when I run tsc -w
, the js files are created in the dist folder at first, but not updated when I change any of the ts files. Tsc seems to be seeing and compiling changes just fine, but fails to write the actual js files.
4:23:04 PM - File change detected. Starting incremental compilation...
4:23:04 PM - Compilation complete. Watching for file changes.
When I omit the outDir parameter from the tsconfig everything works (js files are being updated when chaning ts files). This is not a desired solution since I want js output to be in dist folder instead of src.
It also works correctly when I skip using the tsconfig.json file and run it directly:
tsc -w --outDir dist src/app.ts
Am I doing something wrong?
Running on win10, tsc 2.6.2, node 7.9.0
tsc
and node. – Haire