generator-webapp
generator-webapp copied to clipboard
Gulp-useref - excessive re-minifications
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}));
});
We made a major changes in the Generator and we need to update the recepies. This process is currently ongoing #742. Did you find a solution? Do you want to help us improve the recipe