-
-
Notifications
You must be signed in to change notification settings - Fork 707
Open
Description
Hello! I have gulp configuration with Pug compilation. When running task with gulp-useref is minificate sames css/js files repeatly on every html page.
I tried use gulp-cache, but seems i use this wrong.
There is my gulpfile.js:
gulp.task('minimization', ['templates', 'styles', 'scripts'], () => {
return gulp.src('.tmp/*.html')
.pipe($.useref({searchPath: ['.tmp', '.']}))
.pipe($.if(/\.css$/, $.cache($.cssnano({safe: true, autoprefixer: false}))))
.pipe($.if(/\.js$/, $.cache($.uglify({compress: {drop_console: true}}))))
.pipe(gulp.dest('dist'))
.pipe($.size({title: 'minimized', showFiles: true}));
});