Open farfromrefug opened 4 years ago
This is my solution (I'm using the older version but it'll work with css2json-loader):
// add /\.module\.scss$/i to exclude!
{ test: /\.scss$/, exclude: [/[\/|\\]app\.scss$/, /\.module\.scss$/i], use: ["raw-loader", "resolve-url-loader", "sass-loader"] },
{
test: /\.module\.scss$/i, use: [
{
loader: "css-loader",
options: {
url: false
}
}, "sass-loader"]
},
We create my.module.scss
with:
@import "../../app-variables";
:export {
accent: $accent-dark;
}
If anyone knows of a better solution, it'd be nice!
@edusperoni i see will try! thanks
In my app i do something like this is sass
The idea is to be able to require within javascript like this
Now
primaryColor
is available everywhere.However this works when i use
css-loader
but not when i usenativescript-dev-webpack/css2json-loader
. Do you have any idea on how i can make it work