-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvue.config.js
79 lines (75 loc) · 1.97 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const pagesObj = {};
const chromeName = ['options'];
chromeName.forEach(name => {
pagesObj[name] = {
entry: `src/${name}/index.js`,
template: `src/${name}/index.html`,
filename: `${name}.html`
};
});
module.exports = {
lintOnSave: false,
pages: pagesObj,
productionSourceMap: false,
configureWebpack: (config) => {
if (process.env.NODE_ENV === 'development') {
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true;
}
return {
resolve: {
// symlinks: false
// alias: {
// 'vue$': 'vue/dist/vue.runtime.js'
// },
},
entry: {
'../service_worker': './src/service_worker.js'
},
output: {
filename: 'js/[name].js',
chunkFilename: 'js/[name].js',
},
// module: {
// rules: [
// {
// test: /.vue$/,
// loader: 'vue-loader'
// }
// ]
// },
// plugins: [
// new VueLoaderPlugin()
// ],
devtool: "cheap-source-map",
// devtool: "inline-source-map",
// plugins: [CopyWebpackPlugin(plugins)]
// 打包不压缩代码,
// optimization: {
// minimize: false,
// minimizer: [new UglifyJsPlugin({
// uglifyOptions: {
// minimize: false,
// compress: false,
// beautify: true,
// mangle: false // Note `mangle.properties` is `false` by default.
// }
// })]
// },
}
},
css: {
extract: {
filename: 'css/[name].css'
// chunkFilename: 'css/[name].css'
}
}
// chainWebpack: config => {
// // 查看打包组件大小情况
// if (process.env.npm_config_report) {
// // 在运行命令中添加 --report参数运行, 如:npm run build --report
// config
// .plugin('webpack-bundle-analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin);
// }
// }
};