Mark all included files as dependencies for watch mode #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theimporter
function and can be overridden. This is a feature thatpostcss-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 toimporter
. 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 thestats.includedFiles
from the dart-sass results, which includes a full list of the files that were encountered during compilation.