This is my folder structure:
webpack.config.js
- sass
-- _partials.scss
-- style-1.scss
-- style-2.scss
And what I want that webpack to automatically detect the files into my sass folder and create css file with the same name, note that there are some sass partials files to:
webpack.config.js
- sass
-- _partials.scss
-- style-1.scss
-- style-2.scss
- css
-- style-1.css
-- style-2.css
I want to load specific css file with html link's tags. I dont know where to put the sass entry and css output folders according to my webpack config's file :
module.exports = {
context: __dirname + '/js/react/entry',
entry: {
page1: './page1.js',
page2: './page2.js',
},
output: {
filename: '[name].js',
path: __dirname + '/js/react/build'
},
module: {
rules: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['env', 'react']
}
},
{
test: /\.scss$/,
use: [
"sass-loader"
]
}
]
}
};
Thanks for helping!