Open patrick99e99 opened 3 years ago
No fix yet? I have the exact same issue
I'm open to a PR!
Still an issue. The node-sass vs dart-sass really took a toll on sass :/
I have @use "sass:math";
in 2 files. One is settings/_svg-uri.scss
and one is settings/_functions.scss
Here is my config.
options: {
hoistUseStatements: true,
resources: ['@/assets/scss/settings/*'],
}
This would expand to this:
But I get this error:
Module build failed. SassError: @use rules must be written before any other rules.
I shouldn't get any error because of the hosting, but I still get one.
I have a weird workaround, I remove the hosting (which make no sense) and manually move one of my file with @use "sass:math";
as the first element before the import glob (had the move it to another folder).
options: {
resources: ['@/assets/scss/functions/svg-uri', '@/assets/scss/settings/*'],
}
I don't understand why there is no error now because there is at leant one @use "sass:math";
which is not at the begging because other file are loaded in between.
I'm still open for code and doc PRs!
I don't know what the problem is and I can't say I understand how this plugin work, sorry.
Ok, I'm dumb. It still doesn't work.
My import was incorrect '@/assets/scss/functions/svg-uri'
instead of '@/assets/scss/functions/_svg-uri.scss'
and it failed silently.
But I think I understand what the problem is.
I have a @use "sass:math";
in 2 files. I should only have it in the file that is imported first.
1) Shouldn't this library deduplicate the @use statement ?
2) Shouldn't the webpack build fail it a file cannot be found ? See my exemple above.
I'm experiencing this as well with @use 'sass:math'
. Is there any update here? Does hoistUseStatements
not work correctly or are we doing something wrong?
Bump still having this issue. Any progress?
I'm open to reviewing a PR.
Another option is that you can hire ShakaCode to address this issue, and we can help you with many other issues.
See shakacode.com and especially https://www.shakacode.com/blog/client-engagement-model/.
If you're interested, please book a time with me.
I have an
icons.scss
file which has in it:And my config has:
Yet I still get: