-
Notifications
You must be signed in to change notification settings - Fork 10
/
vue.config.js
31 lines (28 loc) · 1.07 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
const path = require('path')
const fs = require('fs')
const resolve = dir => {
return path.join(__dirname, dir)
}
// 这里需要修改为你线上项目存放的路径
// 比如你打包的文件放到服务器的my-app文件夹,域名为a.com,则应改为
// http(s)://a.com/my-app/
const BASE_URL = ''
module.exports = {
// Project deployment base
// By default we assume your app will be deployed at the root of a domain,
// e.g. https://www.my-app.com/
// If your app is deployed at a sub-path, you will need to specify that
// sub-path here. For example, if your app is deployed at
// https://www.foobar.com/my-app/
// then change this to '/my-app/'
baseUrl: BASE_URL,
// tweak internal webpack configuration.
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
.set('_c', resolve('src/components'))
.set('_conf', resolve('config'))
}
}