gulpjs / gulp

A toolkit to automate & enhance your workflow

Home Page:https://gulpjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp imagemin task is not working properly for the v5.0.0 gulp

sshreya2000 opened this issue · comments

Before you open this issue, please complete the following tasks:

  • use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
  • if you are looking for help from the gulp team or community, open a discussion.
  • if you think there is a problem with the plugin you're using, open a discussion.
  • if you think there is a bug in our code, open this issue.

What were you expecting to happen?

What actually happened?

Please give us a sample of your gulpfile

import gulp from 'gulp';
import imagemin from 'gulp-imagemin';

gulp.task('default', () => {
    // define task
    return gulp.src("src/images/*")
        .pipe(imagemin())
        .pipe(gulp.dest("dest/images"))
});

Terminal output / screenshots

PS C:\Users\ssshr\Coding ninja Text Docs\NodeJS\Basics-1\taskRunner\gulp tasks> gulp
[21:05:07] Using gulpfile ~\Coding ninja Text Docs\NodeJS\Basics-1\taskRunner\gulp tasks\gulpfile.js
[21:05:07] Starting 'default'...
gulp-imagemin: Minified 0 images
[21:05:14] Finished 'default' after 6.64 s


### Please provide the following information:
* OS & version [e.g. MacOS Catalina 10.15.4]: windows 11 23H2
* node version (run `node -v`): v20.10.0
* npm version (run `npm -v`): 10.2.3
* gulp version (run `gulp -v`): cli: 3.0.0, local: 5.0.0

### Additional information
<!-- Add any other information you might have about the problem here. -->

Before you open this issue, please complete the following tasks:

  • use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
  • if you are looking for help from the gulp team or community, open a discussion.
  • if you think there is a problem with the plugin you're using, open a discussion.
  • if you think there is a bug in our code, open this issue.

What were you expecting to happen?

What actually happened?

Please give us a sample of your gulpfile

import gulp from 'gulp';
import imagemin from 'gulp-imagemin';

gulp.task('default', () => {
    // define task
    return gulp.src("src/images/*")
        .pipe(imagemin())
        .pipe(gulp.dest("dest/images"))
});

Terminal output / screenshots

PS C:\Users\ssshr\Coding ninja Text Docs\NodeJS\Basics-1\taskRunner\gulp tasks> gulp [21:05:07] Using gulpfile ~\Coding ninja Text Docs\NodeJS\Basics-1\taskRunner\gulp tasks\gulpfile.js [21:05:07] Starting 'default'... gulp-imagemin: Minified 0 images [21:05:14] Finished 'default' after 6.64 s


### Please provide the following information:
* OS & version [e.g. MacOS Catalina 10.15.4]: windows 11 23H2
* node version (run `node -v`): v20.10.0
* npm version (run `npm -v`): 10.2.3
* gulp version (run `gulp -v`): cli: 3.0.0, local: 5.0.0

### Additional information
<!-- Add any other information you might have about the problem here. -->

you must add encoding option to src like this

return src([`${paths.imagesFolder.src}/**/**.{jpg,jpeg,png,svg}`], { encoding: false })

We're working on documenting this better - closing since this is a dupe of other open tickets.