My project structure:
webpack.config.js
app--
--> src
---->> components
------>>> myComponent.js
------>>> myComponent.scss
--> styles
---->> variables.scss
In webpack.config module.exports:
...
resolve: {
alias: {
styles: path.join(__dirname, 'app/styles')
}
}
In my file - myComponent.scss:
@import "styles/variables";
I am getting this error when building bundle.js:
Module build failed:
@import "styles/variables";
^
File to import not found or unreadable: styles/variables
How can I @import aliases in sass files?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…