Last active
July 25, 2020 23:16
-
-
Save carrieforde/5b59a40389673f9d549b543eb636a0c2 to your computer and use it in GitHub Desktop.
Creating multiple output files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
module.exports = { | |
context: __dirname, | |
entry: { | |
block_one: ["./block-one/index.js", "./block-one/styles.css"], | |
block_two: ["./block-two/index.js", "./block-two/styles.css"], | |
}, | |
output: { | |
path: path.resolve(__dirname, "dist"), | |
filename: "[name]/bundle.js", | |
}, | |
mode: "development", | |
module: { | |
rules: [ | |
{ | |
test: /\.jsx?$/, | |
loader: "babel-loader", | |
}, | |
{ | |
test: /\.s?css$/, | |
use: [MiniCssExtractPlugin.loader, "css-loader"], | |
}, | |
], | |
}, | |
plugins: [ | |
new MiniCssExtractPlugin({ | |
filename: "[name]/styles.css", | |
}), | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment