-
Notifications
You must be signed in to change notification settings - Fork 14
/
vue.config.js
52 lines (49 loc) · 1.16 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
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
const port = process.env.port || process.env.npm_config_port || 8081 // dev port
module.exports={
publicPath: '', //dev ./ prod /
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: false,//process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: port,
open: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
'/api': { //这里最好有一个 /
target: '58.210.9.131:8280', // 后台接口域名
ws: true, //如果要代理 websockets,配置这个参数
secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, //是否跨域
pathRewrite:{
'^/api':''
}
}
},
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: "数字孪生平台",
resolve: {
alias: {
'@': resolve('src')
}
}
},
css:{
//全局配置utils.scss
loaderOptions:{
sass:{
prependData:`@import "@/styles/utils.scss";`
}
}
}
}