I am starting with TypeScript using Visual Studio 2012 Ultimate. I have changed my MSBuild including the --module amd tag in the compiler command. The compiler started to generate AMD modules.
I have include in my project RequireJS from Nuget Packages and include in my main HTML this line:
<script type="text/javascript" data-main="scripts/SiteMaster" src="scripts/require.min.js"></script>
I have two Modules SiteMaster and Authenticate. The module SiteMaster is simple:
export module SiteMaster {
import auth = module("Authenticate");
auth.Authenticate.run();
}
It just imports the Authenticate module and calls the function run(). The js for SiteMaster is like this:
define(["require", "exports"], function(require, exports) {
(function (SiteMaster) {
var auth = __auth__;
auth.Authenticate.run();
})(exports.SiteMaster || (exports.SiteMaster = {}));
})
The problem is that when I browse the solution I receive the error:
Microsoft JScript runtime error: '__auth__' is undefined
How can I solve this problem ???
Thanks in advance.