Is it feasible to incorporate a plugin like clean-css to minify CSS every time a page is refreshed or saved? How can I chain it through pipes to ensure that the minified file ends up in the dist folder? Thank you for any assistance!
Presented below is the existing code snippet:
gulp.task('styles', function(){
return gulp.src('css/style.css')
.pipe(postcss([cssImport, mixins, cssvars, nested, hexrgba, autoprefixer]))
.on('error', function(errorInfo){
console.log(errorInfo.toString());
this.emit('end');
})
// Specify destination folder for stylesheet
.pipe(gulp.dest('dist/styles'));
});