A
A
Alexander Vladimirovich2017-06-09 09:42:55
Sass
Alexander Vladimirovich, 2017-06-09 09:42:55

Gulp sass how to build correctly so that only those @imports that have changed are processed?

I have a build.scss with only imports
. And the more of them, the slower the project builds, even if the changes are only in one file. How to make gulp sass only process imports that have changed?

gulp.task('scss-dev', function () {
    return gulp.src(['./site/main.scss'])
        .pipe(sourcemaps.init())
        .pipe(sass())
        .pipe(replace('../fonts/', ''))
        .pipe(autoprefixer({
            browsers: ['last 3 versions'],
            cascade: false
        }))
        .pipe(cssnano({discardUnused: {fontFace: false}}))
        .pipe(concat('build.css'))
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest('../www/capsule/static'))
        .pipe(touch());
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gpyshenko, 2017-06-13
@gpyshenko

Update Gulp to version 4, unless of course it's not version 4)) There is a feature Or go to the screencast from learn.javascript, it says just that))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question