-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
54 lines (49 loc) · 1.23 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
const path = require('path')
const svgFilePath = path.join(__dirname, 'src/assets/icons/')
const nodeModulePath = path.join(__dirname, 'node_modules/')
const remoteServer = 'http://192.168.251.211:8080'
module.exports = {
baseUrl: './',
assetsDir: 'assets',
devServer: {
proxy: {
'/api': {
target: remoteServer,
ws: true,
changeOrigin: true
},
}
},
chainWebpack: config => {
config.module
.rule('vue-svgicon')
.test(/\.svg$/)
.exclude.add(/-bg\.svg$/).end()
.use('svgicon')
.loader('@yzfe/vue-svgicon-loader')
.options({
idSeparator: '_',
svgFilePath
})
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.transformAssetUrls = options.transformAssetUrls || {}
options.transformAssetUrls['svg-icon'] = ['data']
return options
})
config.module.rule('svg').exclude.add(svgFilePath)
config.resolve.alias.set('@icon', svgFilePath)
config.resolve.alias.set('node_modules', nodeModulePath)
config.resolve.symlinks(false)
},
transpileDependencies: [
'vue-echarts',
'resize-detector'
],
css: {
modules: false
}
}