-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.config.js
36 lines (35 loc) · 1009 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
module.exports = {
mode: "production",
entry: {
play: "./public/dev/js/play.js",
index: "./public/dev/js/index.js",
styles: "./public/dev/scss/styles.scss",
},
output: {
path: path.resolve(__dirname, "public/prod"),
filename: "[name].js",
},
module: {
rules: [
{
test: /\.scss$/i,
exclude: /node_modules/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
],
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()],
},
plugins: [
new TerserPlugin(),
new MiniCssExtractPlugin({
filename: "styles.css",
}),
],
};