excubo-ag / WebCompiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SassCompiler.GetDependencies does not match @use or @forward

rwasef1830 opened this issue · comments

Thanks to the switch to DartSassHost we can now use @use and @forward, however, the SassCompiler.GetDependencies function does not take these files into account when deciding the last write time of the file and its dependencies which leads to an extremely annoying bug that webcompiler launches and terminates and does nothing because it didn't pick up the changes in files referenced in this way.

Quite right! The rules for determining dependencies need to be adapted, which I'll do soon. Thanks for raising this.

Hi @rwasef1830,

Preview 8 is now available and should correctly handle @use and @forward. Please let me know if you find more issues!

BR
Stefan

@stefanloerwald

The fix is not complete, in @use and @forward, it's possible to refer to the file without extension, and also it's possible to reference the file with leading underscore name without the leading underscore and without extension

file: _test.scss
inside main.scss: @use "test"

So you have to add extension .scss and .css and search for them and try the file name with leading underscore as well and consider all of them as dependencies (and prefer .scss when both .scss and .css present and no extension referenced).

The extensions .scss and .sass are already handled, same as leading underscores. I didn't know about the possiblity to use .css extensions, so that I'll still have to add.

This isn't handled by the regex, but by the code below which translates the urls to file paths.

Support added in preview 9 (commit 94c8835)

Super! Thank you for the amazing quick response!

You just seem to catch me at the right time ;-)