1

So I'm working on an older solution where we're on Angular 1.6. I decided to make it somewhat more up to date by adding using ES6. We're using grunt as a task runner so I introduced babel as a watch-task, where I add transpiled files to its own dir. After that I concatinate the files to one big file using grunt-contrib-concat, and then minify by using grunt-contrib-uglify. The concatinated file runs fine, but when minified a function from babel is hoisted and with this, breaks angular when I try to run my site.

This is added to the top of the .min.js file

"use strict";function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function o(r,i){try{var a=t[r](i),d=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(d).then(function(e){o("next",e)},function(e){o("throw",e)});e(d)}("next")})}}

In the concatinated file, this file is added at line 3700 and doesn't break execution. Anyone tips would be greatly appreciated

Edit: This is different from the problem described bellow as all angular controllers, directives, services etc are annotated correctly.

Coss
  • 453
  • 1
  • 4
  • 12
  • Possible duplicate of [Minification is breaking my AngularJs code](https://stackoverflow.com/questions/20266376/minification-is-breaking-my-angularjs-code) – Kaustubh Khare Apr 09 '18 at 11:53

0 Answers0