-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
60 lines (58 loc) · 1.39 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
55
56
57
58
59
60
// vue.config.js
const path = require('path')
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
// 基本路径
publicPath: './',
// 构建时的输出目录
outputDir: 'dist',
// 放置静态资源的目录
assetsDir: 'static',
// index.html 的输出路径
indexPath: 'index.html',
// 文件名哈希
filenameHashing: true,
// 是否在保存的时候使用 `eslint-loader` 进行检查
lintOnSave: true,
// 生产环境是否生成 sourceMap 文件
productionSourceMap: false,
// 配置 webpack-dev-server 行为。
devServer: {
open: false,
host: '0.0.0.0',
port: 8080,
https: false,
hotOnly: false,
proxy: {
'/api': {
target: 'https://test.xxx.com', // 测试环境URL
// ws: true, // 是否启用websockets
changeOrigin: true, // 开启代理,在本地创建一个虚拟服务端
secure: false
}
},
before: () => {}
},
css: {
loaderOptions: {
// provide global variables
sass: {
prependData: `
@import "~@/styles/mixins.scss";
@import "~@/styles/variables.scss";
`
}
}
},
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.
resolve: {
alias: {
'@': resolve('src')
}
}
}
}