-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
39 lines (36 loc) · 1.21 KB
/
webpack.common.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
37
38
39
const webpack = require("webpack"),
htmlWebpackPlugin = require("html-webpack-plugin"),
{ CleanWebpackPlugin } = require('clean-webpack-plugin'),
CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
module.exports = {
entry: ["./src/client/index.js"],
module: {
rules: [
{
test: '/\.js$/',
exclude: /node_modules/,
loader: "babel-loader"
},
]
},
optimization: {
minimizer: [
// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
// `...`,
new CssMinimizerPlugin(),
],
minimize: true,
},
plugins: [
new htmlWebpackPlugin({
template: "./src/client/views/index.html",
filename: "./index.html"
}),
new CleanWebpackPlugin({
dry: true,
verbose: false,
cleanStaleWebpackAssets: true,
protectWebpackAssets: false,
}),
]
}