question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import change not triggering parent file re-compile.

See original GitHub issue

I’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:closed
  • Created 9 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
nucklearprojectcommented, Feb 4, 2018

This plugin solve this issue https://www.npmjs.com/package/gulp-dependents

1reaction
ShaneHowellcommented, Mar 27, 2014

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found