Reputation: 11
As from the title, I don't know where to start configuring anything in order to be able to use .scss files for my components. I know how to configure loaders in webpack.config.js, but in the boilerplate I have, there is no webpack.(dev|prod).config.js
I've read that I should create a .babelrc, but then I got lost. Can anyone help me with this?
structure of my project: structure folders of project
Upvotes: 1
Views: 140
Reputation: 8096
You'll need to install a few loaders with npm
:
npm i style-loader css-loader sass-loader --save-dev
Then you'll need to add the loaders to the module
section of your webpack config file:
module: {
loaders: [
// Sass
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
},
// CSS
{
test: /\.css$/,
loader: 'style-loader!css-loader'
}
}
Upvotes: 1