Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mtime on scss target file #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gpeterso
Copy link
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