After reviewing many questions on the same topic, none of them were able to solve my specific case.
Our current challenge involves bundling and minifying AngularJs files within .Net code. The following code snippet shows how we are bundling our files inside BundleConfig.cs
bundles.Add(new ScriptBundle("~/bundles/js/spa").IncludeDirectory(
"~/App", "*.js", true
));
...
...
BundleTable.EnableOptimizations = true;
In the browser, we are encountering errors that seem to be nonsensical - missing semicolons that are actually present, runtime errors when everything appears to be correct, etc.
/* Minification failed. Returning unminified contents.
(1746,27-35): run-time error JS1006: Expected ')': function
(1746,42): run-time error JS1004: Expected ';'
(1751,57): run-time error JS1004: Expected ';'
....
....
https://i.stack.imgur.com/pSwPX.png
I am unsure where to begin troubleshooting. Should I focus on the .Net bundler or the JS code? Unfortunately, moving the minification inside the angularjs code is not a feasible option for us.
.Net framework version: 4.7. AngularJs version:
"angular": "^1.8.0"
Thank you in advance!