0

I have read this post below:

Type Script is not generating JavaScript in my Visual Studio Community edition 2015

VS2015 Typescript compile to single file on save not working

TypeScript "Compile on save" feature not working in Visual Studio 2015

Regarding: "Do you bundle the JavaScript / TypeScript with another Tool?"

I am not sure whether I bundle the javascript with another tool or not. I am just using the default typescript functionality from visual studio 2015.

my probem is different. everytime I modify and save the typescript file, I have to stop debugging and start debugging again in visual studio so the javascript sync with the new typescript. is it possible not to do this? can i just save the typescript file without havign to redebug for the visual studio to refresh the javascript file? i am using visual studio 2015

this is my tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es2015", "dom" ],
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true,
    "compileOnSave": true,
    "watch": true
  }
}

enter image description here

enter image description here

Community
  • 1
  • 1
jay
  • 1,055
  • 3
  • 15
  • 35
  • Can you include the tsconfig.json from your project? How are the JavaScripts are integrated into the page? Do you bundle the JavaScript / TypeScript with another Tool? – Markus May 07 '17 at 05:57
  • Possible duplicate of [TypeScript "Compile on save" feature not working in Visual Studio 2015](http://stackoverflow.com/questions/31750964/typescript-compile-on-save-feature-not-working-in-visual-studio-2015) – Sanket May 07 '17 at 10:46

1 Answers1

0

Finally found the answer.

as described in https://github.com/Microsoft/TypeScript/issues/2375

just run the following on command prompt on your web project folder and ensure you have tsconfig.json:

tsc --watch

and not sure why, as opposed to most advice, do NOT include :

 "compileOnSave": true,
    "watch": true

in the tsconfig.json. otherwise tsc --watch won't work.

If you execute the command prompt properly, everytime you change your ts file, you should see the following log in your command prompt:

enter image description here

Liam
  • 27,717
  • 28
  • 128
  • 190
jay
  • 1,055
  • 3
  • 15
  • 35