yarn global add gulp-cli
cd c:\inetpub\wwwroot\dnnsite
yarn add --dev gulp@next gulp-babel gulp-imagemin
code gulpfile.js
gulp.src('img/src/*.jpg')
.pipe(somePlugin())
.pipe(gulp.dest('img/min/'))
gulp.task('minify-images', ['copy-images'], function () {
return gulp.src('img/src/*.jpg')
.pipe(somePlugin())
.pipe(gulp.dest('img/min/'));
});
gulp.watch('img/src/*.jpg', ['minify-images']);
gulp.src('img/src/*.jpg')
.pipe(somePlugin())
.pipe(gulp.dest('img/min/'))
gulp.task('minify-images', function () {
return gulp.src('img/src/*.jpg')
.pipe(somePlugin())
.pipe(gulp.dest('img/min/'))
});
// or
gulp.task(function minifyImages() {
return gulp.src('img/src/*.jpg')
.pipe(somePlugin())
.pipe(gulp.dest('img/min/'))
});
gulp.task(
'images',
gulp.series('copyImages', 'minifyImages'));
gulp.task(
'default',
gulp.parallel('js', 'css', 'images'));
gulp.watch('img/src/*.jpg', minifyImages);
gulp.watch(
'img/src/*.jpg',
gulp.parallel('copyImages', 'minifyImages'));