Answer the question
In order to leave comments, you need to log in
Is it possible to update the style file path in the header using gulp?
Good day! I use gulp in development, I created the following task to minify styles:
const gulp = require('gulp'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
browserSync = require('browser-sync'),
cleancss = require('gulp-clean-css'),
rev = require('gulp-rev'),
autoprefixer = require('gulp-autoprefixer');
gulp.task('minify-css', () => {
return gulp.src([
'view/css/main.css',
'view/css/responsive.css',
])
.pipe(cleancss({ level: { 1: { specialComments: 0, } } } ))
.pipe(autoprefixer({
overrideBrowserslist: ['last 10 versions']
}))
.pipe(concat('main-styles.min.css'))
.pipe(rev())
.pipe(gulp.dest('view/min'))
});
Answer the question
In order to leave comments, you need to log in
If anyone is interested, used this plugin . There are well described examples of use and options.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question