gulp.task('js', function () {
return gulp.src(['public/js/**/*.js','public/js/*.js'])
.pipe(ngmin())
.pipe(uglify())
.pipe(concat('app.js'))
.pipe(gulp.dest('dist/public/js'));
});
我遇到此任务的问题,错误是:
[13:23:41] Using gulpfile ~/workspace/mean-blog/gulpfile.js
[13:23:41] Starting 'js'...
events.js:72
throw er; // Unhandled 'error' event
^
Error: Line 2: Unexpected token function
at throwError (/home/caio/workspace/mean-blog/node_modules/gulp-ngmin/node_modules/ngmin/node_modules/esprima/esprima.js:1156:21)
at throwUnexpected (/home/caio/workspace/mean-blog/node_modules/gulp-ngmin/node_modules/ngmin/node_modules/esprima/esprima.js:1209:13)
我认为问题是路径,但我无法识别错误。
答案 0 :(得分:0)
您应该使用mangle选项运行uglify
.uglify({mangle: false})