-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathvue.config.js
33 lines (32 loc) · 1.04 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
const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack')
// const nodeExternals = require('webpack-node-externals')
// 打包大小分析:只在用到的时候解开注释
// const BundleAnalyzerPlugin =
// require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = defineConfig({
transpileDependencies: true,
publicPath: '/print-template-designer',
configureWebpack: {
optimization: {
concatenateModules: false
},
output: {
libraryExport: 'default'
},
externals:
process.env.NODE_ENV === 'production'
? ['vue', 'vuex', 'element-ui', 'vxe-table', 'xe-utils', 'shepherd.js', 'remixicon']
: [],
plugins: [
// 打包大小分析:只在用到的时候解开注释
// new BundleAnalyzerPlugin(),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1
// 限制只打一个包,不分Chunk
// fix SyntaxError: Unexpected character '<'
// https://www.jianshu.com/p/8a4d627e4bec
})
]
}
})