gulp-图像输入:错误"pPipe(...) is not a function"
gulp-imagemin: error "pPipe(...) is not a function"
运行 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',
],
);
- Gulp:
3.9.1
- Gulp-Imagemin:
3.2.0
这似乎是 gulp-imagemin
当前版本的问题。但它应该用即将发布的版本修复,根据那个问题:https://github.com/sindresorhus/gulp-imagemin/issues/261
运行 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',
],
);
- Gulp:
3.9.1
- Gulp-Imagemin:
3.2.0
这似乎是 gulp-imagemin
当前版本的问题。但它应该用即将发布的版本修复,根据那个问题:https://github.com/sindresorhus/gulp-imagemin/issues/261