vue.config.js
1.2 KB
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
// vue.config.js
const path = require('path')
module.exports = {
publicPath: './',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV == 'development',
productionSourceMap: false,
devServer: {
proxy: {
'/compass': {
target: 'https://testznzl.lgyzpt.com/',
//target: 'http://39.107.104.220:8877',
changeOrigin: true,
pathRewrite: {
'^/compass': 'compass'
}
}
},
host: '0.0.0.0',
port: '8080',
open: false
},
configureWebpack: {
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
devtool: 'source-map'
},
chainWebpack: config => {
// 配置SVG图标
config.module
.rule('svg')
.exclude.add(path.resolve(__dirname, 'src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(path.resolve(__dirname, 'src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
},
css: {
loaderOptions: {
sass: {
prependData: `@import "@/assets/styles/variables.scss";`
}
}
}
}