forked from ecomfe/vue-echarts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
47 lines (43 loc) · 1.11 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
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
outputDir: 'demo',
transpileDependencies: ['resize-detector'],
chainWebpack: config => {
config
.entry('app')
.clear()
.add('./src/demo/main.js')
const svgRule = config.module.rule('svg')
// clear all existing loaders.
// if you don't do this, the loader below will be appended to
// existing loaders of the rule.
svgRule.uses.clear()
svgRule
.use('raw-loader')
.loader('raw-loader')
.end()
config.optimization.clear('splitChunks').splitChunks({
cacheGroups: {
vue: {
name: 'echarts',
test: /[\\/]node_modules[\\/]echarts[\\/]/,
priority: 0,
chunks: 'initial'
},
vendors: {
name: 'chunk-vendors',
test: /[\\/]node_modules[\\/]/,
priority: -10,
chunks: 'initial'
},
common: {
name: 'chunk-common',
minChunks: 2,
priority: -20,
chunks: 'initial',
reuseExistingChunk: true
}
}
})
}
}