你好呀
我正在做一个我正在使用Gulp的项目。在我使用Autoprefixer Plugin 和Watch Command 之前一切正常。现在当我在终端运行gulp时。我的 Windows 10 关闭,没有任何错误 消息。
gulpfile.js 代码
var gulp = require("gulp"),
image_minify = require("gulp-image"),
plumber = require("gulp-plumber"),
autoprefixer = require("gulp-autoprefixer");
/* Image Minify */
gulp.task("imageMinify", function() {
gulp.src("assets/images/**/*")
.pipe(plumber())
.pipe(image_minify())
.pipe(gulp.dest("assets/images/mini"));
});
/* Css Autoprefixer */
gulp.task("prefix", function() {
gulp.src("assets/css/*.css")
.pipe(plumber())
.pipe(autoprefixer({ browsers: ["last 10 versions"] }))
.pipe(gulp.dest("assets/style.css"));
});
/* Watch Function (watch the src and make action) */
gulp.task("watch", function() {
gulp.watch("assets/images/**/*", ["imageMinify"]);
gulp.watch("assets/css/*.css", ["prefix"]);
});
/* Default Function */
gulp.task("default", ["watch", "imageMinify", "prefix"]);
Package.json 代码
"devDependencies": {
"gulp-autoprefixer": "^4.0.0",
"gulp-image": "^3.0.0",
"gulp-imagemin": "~3.3.0",
"gulp-plumber": "^1.1.0"
}
请问有什么帮助吗?
提前致谢