Search code examples
javascriptvisual-studiotypescriptvisual-studio-2017

Typescript not compiling on save or publish in Visual Studio 2017


It seems not matter what I do, I cannot get my .ts files to compile into .js files. I have uninstalled and reinstalled Visual Studio 2017 Community and I now have VS 2017 15.2 (26430.15) and Typescript 2.2.2.0 (according to the About window inside VS).

Steps I am taking:

  • Open Visual Studio, File -> New Project
  • ASP.Net Web Application (.Net Framework)
  • Select 'empty' template, add references for MVC
  • Add a new folder called 'Scripts'
  • Add a new ts file called ts1.ts
  • Open ts1.ts and add single line (e.g. var a = 1)
  • Save - no JS emitted.
  • Build - no JS emitted.
  • Ask VS really nicely - no JS emitted.

I've tried it with/without tsconfig.json and I have tried adding compileOnSave to tsconfig when I have added it.

Help?

edit: There are no build errors or warnings and I get a message in the footer saying Output(s) generated successfully.


Solution

  • Spot the idiot.

    I had to enable 'view all files' to see the generated JS.

    enter image description here