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

Mark all included files as dependencies for watch mode #31

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

dgreif
Copy link
Contributor

@dgreif dgreif commented Mar 8, 2022

This is a fix for #19. I believe this stems from sass/dart-sass#574 - TL;DR dart-sass does not perfectly match node-sass when it comes to the importer option. In node-sass, all imports are passed to the importer function and can be overridden. This is a feature that postcss-sass was leveraging to gather dependencies for watch mode. However, in dart-sass any imports that can be resolved as a relative path do not get passed to importer. This is why most of our child imports are no longer watched.

The workaround is to do something like sass-loader does here, which is to look at the stats.includedFiles from the dart-sass results, which includes a full list of the files that were encountered during compilation.

@Antonio-Laguna
Copy link
Member

@dgreif thanks a lot for taking the time to submit this. Looks sane to me and I'm glad you're leveraging messages to send dependencies!

Will merge and release!

@Antonio-Laguna Antonio-Laguna merged commit 85a0d68 into csstools:main Mar 8, 2022
@dgreif
Copy link
Contributor Author

dgreif commented Mar 8, 2022

Thanks @Antonio-Laguna! Glad to see some movement on this project again, really appreciate the recent releases!

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.

None yet

2 participants