This project is read-only.


Compile on Save and Export AMD Modules


Thanks cretz, I added <TypeScriptModuleKind>AMD</TypeScriptModuleKind> as you suggested.  This causes visual studio to output the correct AMD modules when I build the project, but still outputs non-amd javascript when it compiles on save.   Looks like it may be a bug in the compile on save feature.

file attachments

Closed Jun 13, 2013 at 7:19 PM by RyanCavanaugh
Fixed in develop branch


jonturner wrote Feb 4, 2013 at 9:01 PM

paulb wrote Feb 4, 2013 at 9:29 PM

I cannot reproduce this issue.

The Compile on Save options specified in the project file only work when inside the context of a project. If you open the .ts file outside that project, it will use the default options.

** Closed by paulb 02/04/2013 1:29PM

MartinHarris wrote Feb 15, 2013 at 9:26 PM

I am seeing the same issue. I've attached a very simple project which exhibits the problem for me under VS2012.

I've changed the project file from the defaults to:
If you load the project and build the solution then the generated file1.js will correctly be output as a require.js compatible module:
define(["require", "exports"], function(require, exports) {
    var Point = (function () {
If you edit file1.ts to (for example) change the name of the 'p' variable and save it then the js file will be regenerated, but it will no longer be an amd module:
var Point = (function () {
Changing other project settings such as source map generation and including comments work as expected across both full solution builds and single file saves.

novaleaf wrote Apr 26, 2013 at 5:24 AM

i am still seeing this issue with, please reopen

paulb wrote Apr 26, 2013 at 7:41 PM

Taking another look.

paulb wrote Apr 26, 2013 at 8:06 PM

Marked as active.

TobiasHei wrote May 6, 2013 at 3:46 PM

I can confirm this error, see also the Stackoverflow Entry which led me here