Closed dgreif closed 2 years ago
@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!
Thanks @Antonio-Laguna! Glad to see some movement on this project again, really appreciate the recent releases!
This is a fix for https://github.com/csstools/postcss-sass/issues/19. I believe this stems from https://github.com/sass/dart-sass/issues/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.