使用gulp打包的时候遇到问题events.js:160 throw er; // Unhandled 'error' event
来源:9-3 如何打包发布-2
慕粉1470025256
2017-05-14
gulpfile的文件内容如下:
var gulp = require("gulp");
var rev = require("gulp-rev");
var revReplace = require("gulp-rev-replace");
var useref = require("gulp-useref");
var filter = require("gulp-filter");
var uglify = require("gulp-uglify");
var csso = require("gulp-csso");
gulp.task("default",function () {
var jsFilter = filter("**/*.js",{restore:true});
var cssFilter = filter("**/*.css",{restore:true});
var indexHtmlFilter = filter(["**/*","!**/index.html"],{restore:true});
return gulp.src("src/index.html")
.pipe(useref())
.pipe(jsFilter)
.pipe(uglify())
.pipe(jsFilter.restore)
.pipe(cssFilter)
.pipe(csso())
.pipe(cssFilter.restore)
.pipe(indexHtmlFilter)
.pipe(rev())
.pipe(indexHtmlFilter.restore)
.pipe(revReplace())
.pipe(gulp.dest("dist"));
});
1回答
-
慕粉1470025256
提问者
2017-05-14
使用gulp打包失败了
00
相似问题