Skip to content

Update mtime on scss target file#122

Open
gpeterso wants to merge 1 commit intoExLibrisGroup:masterfrom
gpeterso:master
Open

Update mtime on scss target file#122
gpeterso wants to merge 1 commit intoExLibrisGroup:masterfrom
gpeterso:master

Conversation

@gpeterso
Copy link
Copy Markdown
Contributor

@gpeterso gpeterso commented Dec 2, 2020

Modify the custom-scss task so that it updates the mtime on the target file (css/custom-scss-compiled.css).

Why is this needed? Normally, gulp.dest() will simply propagate the source file's mtime to the target file. In this case, the source file is scss/main.scss.

Suppose your main.scss file contains the following line:

@import "variables";

If you modify scss/_variables.scss, the watch-custom-scss task will trigger an update to css/custom-scss-compiled.css). However, the updated file's mtime will remain unchanged because the mtime on scss/main.scss has not changed. As a result, the watch-css task will not know that css/custom1.css needs to be rebuilt.

I'm guessing this is an unintended side-effect of changing the watch-css task to use polling instead of filesystem events (f34630e). Simply touching the target file seems like the most straightforward solution.

Modify the custom-scss task such that it updates the mtime on
the target file (css/custom-scss-compiled.css).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant