NB: I'm using TypeScript under Visual Studio 2010, so unfortunately using Web Essentials 2012 as a solution is not an option.
TypeScript 0.8.2 has added a feature to compile on save which I have enabled on my project by following the instructions on that page. The only additional change I have made to my project file is to add a
<TypeScriptModuleKind>amd</TypeScriptModuleKind>
property to each of the groups which tells TypeScript to build my files as AMD modules.
This works fine when the project is fully built, but when I save a single file and the auto-compilation triggers it does so without the module switch and the generated Javascript no longer works.
Is there anyway to force the compile on save feature to apply certain parameters to the tsc call?
Update:
A little more searching and I found this work item where someone else has the same issue. It was closed as can not reproduce, so can anybody out there confirm that it works for them and if I should take this quote:
The Compile on Save options specified in the project file...
To imply that there is some way of setting the options for Compile on Save separately to the debug and release options defined on the wiki page I linked to above?
This issue has been fixed in subsequent releases; also issues related to the ability to specify an output file for Compile-on-Save. if you are using Visual Studio 2012 or Visual Studio 2013 consider upgrading to a later build.
You can try out the 0.9.5 beta from: https://typescript.codeplex.com/wikipage?title=TypeScript%200.9.5%20beta
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