0

你好呀

我正在做一个我正在使用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"
  }

请问有什么帮助吗?

提前致谢

4

1 回答 1

0

问题是性能问题

我的窗户是V 10,Ram 是4

对我有用的解决方案是将窗口版本从 10 换成 7 终极版,效果很好

另一个将 Ram 更改为 8 或更高的好解决方案
但我更喜欢第一个,因为我对 Windows 10 的性能不满意 :)

于 2018-04-15T08:27:06.330 回答