mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-15 03:33:19 +08:00
feat: v4
This commit is contained in:
47
vue.config.js
Normal file
47
vue.config.js
Normal file
@ -0,0 +1,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
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user