generator-webapp icon indicating copy to clipboard operation
generator-webapp copied to clipboard

Gulp-useref - excessive re-minifications

Open olzhaskaliyev opened this issue 5 years ago • 1 comments

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}));
});

olzhaskaliyev avatar Oct 06 '18 05:10 olzhaskaliyev

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

UlisesGascon avatar Oct 28 '19 18:10 UlisesGascon