Skip to content

Commit abfb167

Browse files
committed
fix(build): set publicURL to index
1 parent 23e36dd commit abfb167

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ wget -qO- https://raw.githubusercontent.com/ly525/luban-h5/dev/deploy/ubuntu-ins
3737
# 1.2 配置相关权限,文档参见:https://ly525.github.io/luban-h5/zh/getting-started/quick-start.html#%E5%90%8E%E7%AB%AF%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA
3838

3939
# 2. 鲁班前端
40-
# 2.1 宿主机访问 「鲁班前端」:localhost:1234/main, 即可看到鲁班的前端
40+
# 2.1 宿主机访问 「鲁班前端」:localhost:1234, 即可看到鲁班的前端
4141
```
4242

4343

deploy/ubuntu-install.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# @Author: ly525
66
# @Date: 2019-11-30 13:24:57
77
# @LastEditors: ly525
8-
# @LastEditTime: 2019-11-30 13:30:07
8+
# @LastEditTime: 2019-12-04 21:13:20
99
# @FilePath: /luban-h5/deploy/ubuntu-install.sh
1010
# @Github: https://github.com/ly525/luban-h5
1111
# @Description:
@@ -34,7 +34,7 @@
3434
# 1.2 config the permission,see more here:https://ly525.github.io/luban-h5/zh/getting-started/quick-start.html#%E5%90%8E%E7%AB%AF%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA
3535

3636
# 2. Luban H5 Front-End
37-
# 2.1visit on your host machine :http://localhost:1234/main, enjoy it!
37+
# 2.1visit on your host machine :http://localhost:1234, enjoy it!
3838
######################################################
3939

4040
######################################################
@@ -64,7 +64,7 @@
6464
# 1.2 配置相关权限,文档参见:https://ly525.github.io/luban-h5/zh/getting-started/quick-start.html#%E5%90%8E%E7%AB%AF%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA
6565

6666
# 2. 鲁班前端
67-
# 2.1 宿主机访问 「鲁班前端」:localhost:1234/main, 即可看到鲁班的前端了
67+
# 2.1 宿主机访问 「鲁班前端」:localhost:1234, 即可看到鲁班的前端了
6868
######################################################
6969

7070
######################################################
@@ -312,8 +312,8 @@ server {
312312
# }
313313
314314
315-
location ^~ /main {
316-
alias /root/luban-h5/front-end/h5/dist/;
315+
location / {
316+
root /root/luban-h5/front-end/h5/dist/;
317317
# index index.html;
318318
#try_files \$uri \$uri/ /index.html;
319319
}

docs/zh/getting-started/deployment.md

-5
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ server {
6868
proxy_pass http://localhost:1337;
6969
}
7070
71-
# 注意:
72-
# 鲁班H5 核心App 部分URL 路径为: https://domain-for-luban/main
73-
# 因此 `luban-h5/front-end/h5/vue.config.js` 中 publicPath 中的配置为 `publicPath: isProd ? '/main/' : '/'`
74-
# 请根据自己的实际情况做调整,如果你的项目是部署在根路径(比如:https://domain-for-luban),修改为: publicPath: '/' 即可
75-
7671
location / {
7772
root /home/centos/codebase/luban/luban-h5-dist/front-end/;
7873
#try_files $uri $uri/ /index.html;

front-end/h5/vue.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require('path')
2-
const isProd = process.env.NODE_ENV === 'production'
2+
// const isProd = process.env.NODE_ENV === 'production'
33
const target = 'http://localhost:1337'
44
const engineOutputDir = path.join(__dirname, '../../back-end/h5-api/public/engine-assets')
55

@@ -18,8 +18,8 @@ switch (process.env.PAGE) {
1818
template: 'public/index.html',
1919
filename: 'index.html',
2020
title: 'Index Page',
21-
outputDir: 'dist',
22-
publicPath: isProd ? '/main/' : '/'
21+
outputDir: 'dist'
22+
// publicPath: isProd ? '/main/' : '/'
2323
}
2424
}
2525

0 commit comments

Comments
 (0)