Angular.module minification bug

前端 未结 8 904
情深已故
情深已故 2020-11-28 03:50

Having the darnedest time trying to figure out why minification is not working.

I have injected via an array object my providers prior the function per numerous sugg

8条回答
  •  萌比男神i
    2020-11-28 04:05

    I had a similar problem. And solved it the following way. We need to run a Gulp module called gulp-ng-annotate before we run uglify. So we install that module

    npm install gulp-ng-annotate --save-dev
    

    Then do the require in Gulpfile.js

    ngannotate = require(‘gulp-ng-annotate’)
    

    And in your usemin task do something like this

    js: [ngannotate(), uglify(),rev()] 
    

    That solved it for me.

    [EDIT: Fixed typos]

提交回复
热议问题