Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-manage-ui
Commits
00768e77
Commit
00768e77
authored
Jan 05, 2023
by
李鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式化
parent
731715cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
45 deletions
+42
-45
vite.config.js
vite.config.js
+42
-45
No files found.
vite.config.js
View file @
00768e77
import
{
defineConfig
}
from
'
vite
'
import
{
defineConfig
}
from
"
vite
"
;
import
vue
from
'
@vitejs/plugin-vue
'
import
vue
from
"
@vitejs/plugin-vue
"
;
const
path
=
require
(
'
path
'
)
const
path
=
require
(
"
path
"
);
console
.
log
(
__dirname
);
console
.
log
(
__dirname
);
function
resolve_path
(
dir
)
{
function
resolve_path
(
dir
)
{
return
path
.
join
(
__dirname
,
'
./
'
,
dir
)
return
path
.
join
(
__dirname
,
"
./
"
,
dir
);
}
}
export
default
{
export
default
{
plugins
:
[
plugins
:
[
vue
()],
vue
()
],
//本地运行基础路径,如:http://localhost:5173/apaas/ui/
//本地运行基础路径,如:http://localhost:5173/apaas/ui/
base
:
"
/apaas/manage/ui/
"
,
base
:
"
/apaas/manage/ui/
"
,
clearScreen
:
false
,
clearScreen
:
false
,
resolve
:{
resolve
:
{
//别名,代码引入时方便引入
//别名,代码引入时方便引入
alias
:{
alias
:
{
'
@
'
:
resolve_path
(
'
src
'
),
"
@
"
:
resolve_path
(
"
src
"
),
}
}
,
},
},
css
:{
css
:
{
devSourcemap
:
true
,
//代码编排,调试时是否能看到源码
devSourcemap
:
true
,
//代码编排,调试时是否能看到源码
},
},
server
:{
server
:
{
host
:
'
0.0.0.0
'
,
//host配置,0.0.0.0会添加本地ip,开启局域网访问路径
host
:
"
0.0.0.0
"
,
//host配置,0.0.0.0会添加本地ip,开启局域网访问路径
hmr
:
true
,
//热更新
hmr
:
true
,
//热更新
open
:
true
,
proxy
:
{
proxy
:
{
// 选项写法
// 选项写法
'
/apaas/system
'
:
{
"
/apaas/system
"
:
{
target
:
'
https://apaas5.wodcloud.com/apaas/system
'
,
// 所要代理的目标地址
target
:
"
https://apaas5.wodcloud.com/apaas/system
"
,
// 所要代理的目标地址
rewrite
:
path
=>
path
.
replace
(
/^
\/
apaas
\/
system/
,
''
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
system/
,
""
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
secure
:
false
,
//解决证书缺失问题
secure
:
false
,
//解决证书缺失问题
},
},
'
/apaas/portal/ui
'
:
{
"
/apaas/portal/ui
"
:
{
target
:
'
https://apaas5.wodcloud.com/apaas/portal/ui
'
,
// 所要代理的目标地址
target
:
"
https://apaas5.wodcloud.com/apaas/portal/ui
"
,
// 所要代理的目标地址
rewrite
:
path
=>
path
.
replace
(
/^
\/
apaas
\/
portal
\/
ui/
,
''
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
portal
\/
ui/
,
""
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
secure
:
false
,
//解决证书缺失问题
secure
:
false
,
//解决证书缺失问题
},
},
'
/apaas/service
'
:
{
"
/apaas/service
"
:
{
target
:
'
https://apaas5.wodcloud.com/apaas/service
'
,
// 所要代理的目标地址
target
:
"
https://apaas5.wodcloud.com/apaas/service
"
,
// 所要代理的目标地址
rewrite
:
path
=>
path
.
replace
(
/^
\/
apaas
\/
service/
,
''
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
service/
,
""
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
secure
:
false
,
//解决证书缺失问题
secure
:
false
,
//解决证书缺失问题
},
},
'
/apaas/common
'
:
{
"
/apaas/common
"
:
{
target
:
'
https://apaas5.wodcloud.com/apaas/common
'
,
// 所要代理的目标地址
target
:
"
https://apaas5.wodcloud.com/apaas/common
"
,
// 所要代理的目标地址
rewrite
:
path
=>
path
.
replace
(
/^
\/
apaas
\/
common/
,
''
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
apaas
\/
common/
,
""
),
// 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
changeOrigin
:
true
,
// true/false, Default: false - changes the origin of the host header to the target URL
secure
:
false
,
//解决证书缺失问题
secure
:
false
,
//解决证书缺失问题
},
},
}
}
,
},
},
build
:{
build
:
{
outDir
:
'
dist/apaas/manage/ui
'
,
//打包输出文件夹
outDir
:
"
dist/apaas/manage/ui
"
,
//打包输出文件夹
assetsDir
:
'
static
'
,
//打包输出静态文件
assetsDir
:
"
static
"
,
//打包输出静态文件
},
},
};
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment