-
Notifications
You must be signed in to change notification settings - Fork 21
sass-variable-loader can support sass @import #9
Comments
can you publish minimum reproducible test case as github repo? |
I am also having this issue. It is easy to repro: variables.scss $myColor: red; component.scss @import "./variables.scss";
.component {
background-color: $myColor;
} component.js // Fails to compile with error: Undefined variable: "$myColor"
import styleVars from "!!sass-variable-loader!./component.scss";
// This works, however
import styleVars from "!!sass-variable-loader!./variables.scss"; It seems that when looking in |
That's correct @azcn2503, it doesn't follow imports. You'd have to import |
After quickly checking this out, I think this also affects the following case:
@function my-custom-color-function ($color) {
@return #ff0000;
}
@import './functions.scss';
$some-var: my-custom-color-function(#fff); Output: import variables from "!!sass-variable-loader!./variables.scss";
console.log(variables.someVar); Expected output would be |
Also experiencing this issue.. any suggested workaround when using the |
@danielgefen found that another package ( |
@Eiskis your fork is working perfectly! Thanks so much. Saved me some time using it. |
@Eiskis is your forked code available somewhere? I have webpack setup to alias scss imports from |
@bristoljon yeah it's on GitHub, I added the repository field to
Have fun :) |
Thanks @Eiskis forgot to look there! |
After I used sass-variable-loader, I find sass-variable-loader can't parse @import scss file.
The text was updated successfully, but these errors were encountered: