I work with Angular and RequireJS. I tried to use RequireJS optimization, and now my application is not working. I am sure it\'s due to minification.
Uncaught Erro
Here are the steps which should make it working for you:
main.js:12
.If source maps are still not working:
Make sure minified JS file contains, at the very bottom, something like:
//# sourceMappingURL=main.js.map
Make sure mapping file is being downloaded. It should be listed in "Network" section of Developer Tools as downloaded during page reload. It should look like this:
Maybe RequireJS's minification strips out the sourceMappingURL
comment from your output JS file?
Make sure that you're using uglify2
method and you've enabled generateSourceMaps
option. Here is relevant part of my requirejs
target config from Grunt:
requirejs: {
compile: {
options: {
/* some other options here */
optimize: 'uglify2',
logLevel: 0,
preserveLicenseComments: false,
generateSourceMaps: true
}
}
}