Import change not triggering parent file re-compile.
See original GitHub issueI’m having an issue with the parent file not re compiling when an import is changed. For example, I have a base file called global.scss which imports a partial _header.scss.
But when the _header.scss is changed, it doesn’t recompile global.scss. The watch task is seeing the file being changed but its parent doesn’t recompile.
[gulp] _header.scss was changed
Watch function:
// Watch SCSS
gulp.src(input_paths.styles, { read: false })
.pipe(plumber()) // Keeps pipes working after error event
.pipe(watch()) // Watches for file changes
.pipe(scss( scss_options )) // SCSS compiler
.pipe( gulp.dest( output_paths.styles ) ) // Output destination
.pipe(livereload(server)) // Reload the page
.pipe( notify( notify_options ) ); // Notify what file was changed
scss_options variable:
// Sass
var scss_options = {
outputStyle: 'compressed', // variables - https://github.com/andrew/node-sass
errLogToConsole: false,
onError: function(err) {
notify().write(err); // Growl it.
console.log(gutil.colors.red(err)); // Log the occurred error.
process.stdout.write('\x07'); // Beep boop the terminal.
}
};
Not 100% sure this is a gulp-sass issue though.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Changing partial scss file does not auto-recompile main ...
My issue is that when I make changes in a partial scss file ... it does not recompile the main file ( example:...
Read more >Changes to imported scss file not triggering rebuild
scss are not applied once the project is built and listening for changes. The changes are detected, since I get this message in...
Read more >NG3003: Import cycles would need to be created to ...
Try to rearrange your dependencies to avoid the cycle. · Move the classes that reference each other into the same file, to avoid...
Read more >PL/SQL Triggers - Database
A trigger is like a stored procedure that Oracle Database invokes automatically whenever a specified event occurs.
Read more >Basic Features: Fast Refresh
If you edit a file with exports that aren't React components, Fast Refresh will re-run both that file, and the other files importing...
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 Free
Top 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
This plugin solve this issue https://www.npmjs.com/package/gulp-dependents
@quarterto IMO, no watch set up should have to recompile every file when only one file has changed. It may be fast but it would still shave off many seconds by only compiling changed files.
I’ve also tested it both ways. While libsass is fast, it’s exponentially faster when only compiling changed files, especially on larger projects.