-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvue.config.js
50 lines (49 loc) · 1.2 KB
/
vue.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
49
50
// const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
// 将 examples 目录添加为新的页面
pages: {
index: {
// page 的入口
entry: "examples/main.js",
// 模板来源
template: "public/index.html",
// 输出文件名
filename: "index.html",
},
},
css: {
loaderOptions: {
sass: {
// eslint-disable-next-line global-require
implementation: require("sass"), // This line must in sass option
},
},
},
// 打包大小分析
// chainWebpack: (config) => {
// config.plugin("webpack-report").use(BundleAnalyzerPlugin, [
// {
// analyzerMode: "static",
// },
// ]);
// },
configureWebpack: (config) => {
const plugins = [
new TerserPlugin({
terserOptions: {
compress: {
warnings: false,
drop_debugger: false,
drop_console: true,
},
},
sourceMap: false,
parallel: true,
}),
];
if (process.env.NODE_ENV !== "development") {
config.plugins = [...config.plugins, ...plugins];
}
},
};