excubo-ag / WebCompiler

Apache License 2.0
148 stars 29 forks source link

"@use ... with ..." not properly handled by GetDependencies #92

Closed JustusGreiberORGADATA closed 1 month ago

JustusGreiberORGADATA commented 1 month ago

I recently switched to the SASS module system and now use @use instead of @import. While I did that, I noticed, that sometimes my files weren't properly recompiled.

I think I know what happens: @use allows the special syntax @use ... with which I use to override some variables. For example

@use "../odid" with (
    /* Bootstrap overrides */
    $primary: colors.$orga-blue,
    $secondary: colors.$orga-gray,
    $form-feedback-valid-color: lighten(colors.$orga-orange, 20%),
);

The code to figure out the dependency tree does not seem to work with this syntax. If I input the example above into the function GetDependencies I get

..\odid with 
\* Bootstrap overrides *

for file_path and

$primary: colors.$orga-blue, 
$secondary: colors.$orga-gray, 
$form-feedback-valid-color: lightencolors.$orga-orange, 20%,

for file_name.

I haven't tried it yet, but I assume the syntax @use ... as will have similar issues.

stefanloerwald commented 1 month ago

Thanks for the bug report! I was able to reproduce and just submitted a fix. It's a bit hacky, so it might break things elsewhere. Please give it a try and report back any new issues.

JustusGreiberORGADATA commented 1 month ago

Did a quick test: The modifications I had problems with before seem to be working with the new version. Thank you for the fast fix 🎉.

If I notice that something else broke, I will report back. But so far everything is working.