-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mpa.config.js
48 lines (47 loc) · 1016 Bytes
/
webpack.mpa.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 UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const env = process.env.NODE_ENV;
module.exports = {
entry: {
about: "./src/assets/scripts/about.js",
auth: "./src/assets/scripts/auth.js",
works: "./src/assets/scripts/works.js",
blog: "./src/assets/scripts/blog.js"
},
output: {
filename: "[name].bundle.js"
},
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
exclude: /node_modules/
},
{
enforce: "pre",
test: /\.js$/,
exclude: /node_modules/,
loader: "eslint-loader"
}
]
},
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
warnings: false,
compress: {
drop_console: true
}
}
})
]
},
resolve: {
alias: {
vue$:
env === "development" ? "vue/dist/vue.esm.js" : "vue/dist/vue.min.js"
}
},
devtool: env === "development" ? "#eval-source-map" : ""
};