-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.23 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
entry: {
main: "./src/scripts/main.js",
analytics: "./src/scripts/analytics.js",
article: "./src/scripts/article.js",
cookies: "./src/scripts/cookies.js",
exhibition: "./src/scripts/exhibition.js",
footnotes: "./src/scripts/footnotes.js",
media: "./src/scripts/media.js",
offline: "./src/scripts/offline.js",
"record-article": "./src/scripts/record-article.js",
"secondary-navigation": "./src/scripts/secondary-navigation.js",
sentry: "./src/scripts/sentry.js",
"service-worker": "./src/scripts/service-worker.js",
sidebar: "./src/scripts/sidebar.js",
},
mode: "production",
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
},
},
},
],
},
output: {
path: path.resolve(__dirname, "app/static"),
filename: "[name].min.js",
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
},
devtool: "source-map",
};