Skip to content

Commit ee0f3ca

Browse files
committed
build: 配置二级域名
1 parent afdc7bf commit ee0f3ca

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.env

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33

44
# 接口的域名
55
# VUE_APP_BASE_HOST=http://yourserver
6-
VUE_APP_BASE_API=/
6+
VUE_APP_BASE_API=/
7+
VUE_APP_BASE_URL=/h5-vue/

vue.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ fs.readdirSync(pagesDir)
2929
console.info(`pages config:${JSON.stringify(pagesCofig)}`);
3030

3131
module.exports = {
32+
baseUrl:
33+
process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_URL : '/',
3234
productionSourceMap: false,
3335
// multi-page 多页模式
3436
pages: pagesCofig,

0 commit comments

Comments
 (0)