Answer the question
In order to leave comments, you need to log in
Optimized incremental scss build?
Good day! How can you optimize the assembly of styles when there is one main.scss file in which the rest of the scss files are included?
There is 1 main.scss file, files like _header.scss, _footer.scss, etc. are included in it. Other main files from other directories are also connected. Like this:
Now the work task for styles rebuilds all styles. It looks like this:
/********************************************************************/
/*STYLES*************************************************************/
/********************************************************************/
gulp.task('style', function () {
return gulp.src(path.src.style)
.pipe(plugins.sourcemaps.init())
.pipe(plugins.sass.sync().on('error', plugins.sass.logError))
.pipe(plugins.autoprefixer({browsers: ['last 2 versions'], cascade: false}))
.pipe(plugins.csso())
.pipe(plugins.rename({suffix: '.min'}))
.pipe(plugins.sourcemaps.write())
.pipe(gulp.dest(path.dist.css))
.pipe(reload({stream: true}));
});
{since: gulp.lastRun('style')}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question