var gulp = require('gulp'); var imgminify = require('gulp-imgminify'); //minify img gulp.task('imgminify',async function () { return gulp.src('src/assets/img/*') .pipe(imgminify()) .pipe(gulp.dest('dis/assets/img')) }); ---------------------------------------------------------- $ npm install --save-dev gulp-imgminify up to date, audited 372 packages in 13s 7 packages are looking for funding run `npm fund` for details 29 vulnerabilities (10 moderate, 11 high, 8 critical) To address issues that do not require attention, run: npm audit fix To address all issues possible (including breaking changes), run: npm audit fix --force Some issues need review, and may require choosing a different dependency. Run `npm audit` for details.