运行gulp-imagemin会导致以下错误:
/.../node_modules/imagemin/index.js:64
const pipe = opts.plugins.length > 0 ? pPipe(opts.plugins)(input) : Promise.resolve(input);
^
TypeError: pPipe(...) is not a function来源:
import plugins from 'gulp-load-plugins';
...
gulp.task('img:production', () =>
gulp.src(`${config.dirs.src}/img/**/*`)
.pipe(plugins().imagemin())
.pipe(gulp.dest(`${config.dirs.dist}/img`))
);
...
gulp.task('build:production',
[
'img:production',
'html:production',
'css:production',
'js:production',
'copy',
'critical',
],
);3.9.13.2.0发布于 2017-05-15 18:25:36
这似乎是当前版本的gulp-imagemin的一个问题。但是,根据这个问题,它应该是用向上开始的版本修复的:https://github.com/sindresorhus/gulp-imagemin/issues/261
https://stackoverflow.com/questions/43983363
复制相似问题