Windows 关闭时 运行 gulp 观看

Windows is off when run gulp watch

你好

我正在做一个我正在使用 Gulp 的项目。在我使用 Autoprefixer 插件和 Watch 命令之前一切正常。现在当我 运行 gulp 在终端。我的 windows 10 已关闭,没有任何 Error 消息。

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"
  }

有什么帮助吗?

提前致谢

问题是性能问题

我的 windows 是 V 10 而 Ram 是 4

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

另一个很好的解决方案,将 RAM 更改为 8 或更高
但我更喜欢第一个,因为我对 windows 10 的表现不满意 :)