我正在尝试使用imagemin缩小图像,但它会出错.无法理解我做错了什么.
这是我的gulpfile
'use strict';
var gulp = require('gulp');
var imagemin = require('imagemin');
var clean = require('gulp-clean');
gulp.task('img', function () {
return gulp.src('src/img/**')
.pipe(imagemin())
.pipe(gulp.dest('build/img'));
});
gulp.task('clean', function() {
console.log('-----------?????? build');
return gulp.src('build', {read: false})
.pipe(clean());
});Run Code Online (Sandbox Code Playgroud)
并且来自控制台的错误消息
$ gulp img
(node:14312) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[22:10:20] Using gulpfile Z:\a\gulpfile.js
[22:10:20] Starting 'img'...
[22:10:20] 'img' errored after 26 ms
[22:10:20] TypeError: dest.on …Run Code Online (Sandbox Code Playgroud)