Watch/recompile only changed sass/scss files
See original GitHub issueHi, This question might be already answered, but i couldn’t find the answer. Recently I switch from Compass SASS to Gulp-sass. So, is it possible with the Watcher to recompile only changed SCSS files? I have huge amount of SCSS files (~60) so it takes around 7-8sec every time I change ONE file. Here is my task and watcher
sassSources = ['../sass/**/*.scss'];
gulp.task('sass', function() {
return gulp.src(sassSources)
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(autoprefixer())
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('resources/css'));
});
gulp.task('watch', function() {
gulp.watch(sassSources, ['sass'])
.on('change', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
});
Any help is appreciated !
Thanks !
Issue Analytics
- State:
- Created 8 years ago
- Comments:9
Top Results From Across the Web
Gulp sass compile only changed changed files' folder
In our pre-production server, we have a bash that run and compiles all siblings scss files when you save one. But i'm failing...
Read more >Upgrade SASS / SCSS to Use Latest CSS - YouTube
In VSCode we use extension that watches SCSS file and converts SCSS ... SASS Compiler may not do anything if you use this...
Read more >How to compile SASS into CSS and watch for changes?
Watching for changes in SASS. Just add a --watch flag in the command to watch the changes made to the Sass file in...
Read more >Sass, SCSS, and Less | CLion Documentation - JetBrains
To compile your code automatically, you need to configure a Sass, Less, or SCSS File Watcher which will track changes to your files...
Read more >Dart Sass Command-Line Interface
It can also compile all Sass files in a directory to CSS files with the same ... Sass will only compile stylesheets whose...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a solution. You need to install the following: gulp-sass-grapher path gulp-watch
And this is the working task:
Good luck !
Haha wow, that’ll do it too, thanks 😃
It would be nice to have this as a gulp-sass one-step option!