4
votes

When I turn on bundling everything bundles and minifies correctly except my angular.js file.

I get the following error:

"Minification failed. Returning unminified contents. (173,115-122): run-time error JS1019: Can't have 'break' outside of loop: break a"

However it seems to return a minified result and the site doesn't load.

I have tried updating the file to angular 1.5.8, and tried bundling the .min.js file but no success.

1
A couple of questions: (1) Could you post the resulting bundle? (2) How do you know minification is failing on angular.js and not on your custom JS code? - Anurag Bhandari
Same problem here, excluded all scripts from bundle one by one to identify the guilty one : angular.js is the one (minified or not, v1.5.8) - sritmak

1 Answers

5
votes

What I end up doing is just remove angular.min.js from project and let ASP bundling process to minimize angular.js and produce final minimized package.

Sometimes I had to do same trick with other JS libs (if my memory serves JQquery..)

Also in our solution we use .min.js files, but devs forget to regenerated this file from source and there were cases when release version had "fixed" but not fixed version of the file. I gave up fighting with this and just deleted all .min.js files. -))