S
S
Sergey2018-07-05 11:36:49
gulp.js
Sergey, 2018-07-05 11:36:49

How to force Gulp to compile only changed files?

There are 2 main files - custom.scss and vendor.scss, in which separate modules are imported.

Example.

custom.scss
@import "_base";
@import "_header";

vendor.scss
@import "_variables";
@import "_iconfont";


When any module changes, a sass task is launched that rebuilds both of these files. Is there a way to keep track of the state of the main file if there are changes in imported files, and based on this, only rebuild it? Maybe there is such a plugin?
Something similar is implemented in gulp-rev-all, where the hash sum of the css file changes if, for example, the picture that is included in it as a background has changed (while the style file itself remains physically untouched).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2018-07-05
@SergeiB

I found several plugins that fit the stated goal: gulp-sass-graph, gulp-sass-inheritance, gulp-dependents, gulp-sass-partials-imported, gulp-watch-and-touch. I settled on gulp-dependents , which, together with gulp-cached, speeds up rebuilding dozens of times.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question