I have been digging around trying to find the answer to this:
How can I debug modular TypeScript with source maps?
TypeScript generating wrong JS in Release Mode
Typescript AMD Modules in Visual Studio
but so far no luck. I have a Visual Studio 2015 Angular project with TypeScript. I am trying to get debugging working. My TypeScript files are coded with CommonJS. When I run the app and try and debug it errors saying "exports is not defined." When I change the app to use AMD it runs in IE but not in chrome as the js gets created like this:
define(["require", "exports"], function (require, exports) {
function sayHello() {
alert("I am here");
}
exports.sayHello = sayHello;
function yo() {
alert("yo");
}
exports.yo = yo;
});
//# sourceMappingURL=TestMessage.js.map
and Chrome now says "define" is not defined. If I leave the mode as CommonJS both Chrome and IE error saying "exports is not defined." Seems like I am missing something here. Any ideas what? Here is why TS file:
export function sayHello() {
alert("I am here");
}
export function yo() {
alert("yo");
}