You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since moving to gulp v4 I have not been able to use imagemin.
environment: windows cmd
gulp -v CLI version: 2.3.0 & Local version: 4.0.2
The closest I have gotten is this:
...
let /** @type {import("gulp-imagemin")} / imagemin;
let /* @type {import("imagemin-jpegtran")} / imageminJpegtran;
let /* @type {import("imagemin-pngquant").default} */ imageminPngquant;
// run this task before any that require imagemin
gulp.task("startup", async () => {
await startup();
});
gulp.task('imageminx', function(done) {
startup;
return gulp.src('./src/images/.')
.pipe(imagemin())
.pipe(gulp.dest('./dist/images/'));
});
...
which, sadly, still reports error:
C:\Source\gulptests>gulp imageminx
[15:41:22] Using gulpfile C:\Source\gulptests\gulpfile.js
[15:41:22] Starting 'imageminx'...
[15:41:22] 'imageminx' errored after 13 ms
[15:41:22] TypeError: imagemin is not a function
at \Mac\Home\Documents\Source\gulptests\gulpfile.js:44:11
at taskWrapper (\Mac\Home\Documents\Source\gulptests\node_modules\undertaker\lib\set-task.js:13:15)
at bound (node:domain:421:15)
at runBound (node:domain:432:12)
at asyncRunner (\Mac\Home\Documents\Source\gulptests\node_modules\async-done\index.js:55:18)
at processTicksAndRejections (node:internal/process/task_queues:78:11)
If I am missing something I apologize for the ticket.
The text was updated successfully, but these errors were encountered:
Since moving to gulp v4 I have not been able to use imagemin.
environment: windows cmd
gulp -v CLI version: 2.3.0 & Local version: 4.0.2
The closest I have gotten is this:
...
let /** @type {import("gulp-imagemin")} / imagemin;
let /* @type {import("imagemin-jpegtran")} / imageminJpegtran;
let /* @type {import("imagemin-pngquant").default} */ imageminPngquant;
const startup = async () => {
// @ts-ignore
imagemin = (await import("gulp-imagemin")).default;
// @ts-ignore
imageminJpegtran = (await import("imagemin-jpegtran")).default;
imageminPngquant = (await import("imagemin-pngquant")).default;
};
// run this task before any that require imagemin
gulp.task("startup", async () => {
await startup();
});
gulp.task('imageminx', function(done) {
startup;
return gulp.src('./src/images/.')
.pipe(imagemin())
.pipe(gulp.dest('./dist/images/'));
});
...
which, sadly, still reports error:
C:\Source\gulptests>gulp imageminx
[15:41:22] Using gulpfile C:\Source\gulptests\gulpfile.js
[15:41:22] Starting 'imageminx'...
[15:41:22] 'imageminx' errored after 13 ms
[15:41:22] TypeError: imagemin is not a function
at \Mac\Home\Documents\Source\gulptests\gulpfile.js:44:11
at taskWrapper (\Mac\Home\Documents\Source\gulptests\node_modules\undertaker\lib\set-task.js:13:15)
at bound (node:domain:421:15)
at runBound (node:domain:432:12)
at asyncRunner (\Mac\Home\Documents\Source\gulptests\node_modules\async-done\index.js:55:18)
at processTicksAndRejections (node:internal/process/task_queues:78:11)
If I am missing something I apologize for the ticket.
The text was updated successfully, but these errors were encountered: