I have the following folder structure:
|- webpack.config.js
|- src/
|- main.js
|- some.other.js.files
|- styles/
|- app.scss
|- animation.scss
|- transition.scss
|- public/
|- js/
|- app.js
I have Webpack configured such that it takes all the css and js files and compiles them as app.js under public/js. Here is the config:
module.exports = {
entry: './src/main.js',
output: {
path: path.to.public.js,
filename: 'app.js'
},
module: {
rules: [
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.scss$/, loaders: ["style-loader", "css-loader", "sass-loader"]},
}
}
Now I want to create another scss file, called static.scss, and instead of getting it added to app.js like the others, I want it to be compiled into a stand-alone css file under public/css. This is so that I can link to it from some html files I have elsewhere in the repository.
How do I do this?