forked from magic-akari/lrc-maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.webpack.config.cjs
34 lines (33 loc) · 1004 Bytes
/
.webpack.config.cjs
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
const { resolve } = require("path");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = (env, argv) => {
const production = argv.mode === "production";
return {
mode: production ? "production" : "development",
devtool: "source-map",
entry: ["./build.es6/polyfill/es6+.js", "./build.es6/polyfill/details-summary.js", "./build.es6/index.js"],
output: {
path: resolve(__dirname, "build"),
filename: "index.es6.js",
},
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
},
],
},
optimization: {
minimize: production,
minimizer: [
new TerserPlugin({
terserOptions: {
safari10: true,
},
}),
],
},
};
};