I'm deploying an Angular application using ASP.NET MVC and Typescript. We use FinalBuilder and MSBuild. We are using Typescript 1.0 and the .js and .js.map-files are not included in the project. When we build only the js files are generated but they include a reference to the source map files like this:
//# sourceMappingURL=App.js.map
This causes Chrome Developer Tools to report a 404 for the .map files since they are never generated by MSBuild.
Is there a way not to generate source maps in release mode but only in debug mode?
We are using VS2013 and MSBuild 12.
The Visual Studio "TypeScript Build" section has a checkbox for "Generate source maps" that is tied to the build configuration. Also tsc has the --sourcemap parameter that you can either include (to generate) or exclude (to not). Most node-based builders (such as grunt-ts) also have this functionality via the config json file. Any of these options should cover you.
That said, source maps aren't requested by the browser unless you have the dev tools open anyway, so this isn't actually a problem for normal users.
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