A brief introduction to the Ng-annotate project, this project provides the Gulp plugin.
Gulp configuration file:
var gulp =Require' Gulp ');var ngannotate =Require' Gulp-ng-annotate '); This onevar gutil =Require' Gulp-util ');var bower =Require' Bower ');var uglify =Require' Gulp-uglify ');VarConcat =Require' Gulp-concat ');var minifycss =Require' Gulp-minify-css ');var rename =Require' Gulp-rename ');var sh =Require' Shelljs ');var ngmin =Require' Gulp-ngmin ');This onevar stripdebug =require ( ' Gulp-strip-debug '); Gulp.task ( ' minify ', function () {return gulp.src ([' Js/appservice.js ', ' js/app.js '])//note, specifically here, Avoid problems caused by order. Pipe (Ngannotate ()). Pipe (Ngmin ({dynamic:false}))//this. pipe (Stripdebug ()). Pipe (uglify ({outsourcemap: false})//Seagull Note here the Outsourcemap Must be added. pipe (concat ( All.min.js ')) . pipe (Gulp.dest (
Angular controller JS compression error after solution