mirror of
https://github.com/talktao/Vue3-Vite-Vant-TS-H5.git
synced 2025-05-25 00:39:18 +08:00
update:增加 静态资源基础路径,用于vite打包找不到资源问题
This commit is contained in:
parent
993bdf5012
commit
61d87e70aa
@ -8,6 +8,10 @@ export default defineConfig(({command, mode})=>{
|
||||
// 检查process.cwd()路径下.env.develeport.local、.env.development、.env.local、.env这四个环境文件
|
||||
loadEnv(mode, process.cwd())
|
||||
return {
|
||||
|
||||
// 静态资源基础路径 base: './' || '',
|
||||
base:'./',
|
||||
|
||||
resolve: {
|
||||
alias:{
|
||||
// 配置src目录
|
||||
@ -20,9 +24,11 @@ export default defineConfig(({command, mode})=>{
|
||||
vue(),
|
||||
// 配置后,Vant各组件才生效
|
||||
styleImport({
|
||||
resolves: [VantResolve()],
|
||||
resolves: [VantResolve()],
|
||||
}),
|
||||
],
|
||||
|
||||
|
||||
|
||||
// 跨域代理
|
||||
server:{
|
||||
@ -30,10 +36,8 @@ export default defineConfig(({command, mode})=>{
|
||||
//这里是通过请求/api 来转发到 https://api.pingping6.com/
|
||||
//假如你要请求https://api.*.com/a/a
|
||||
//那么axios的url,可以配置为 /api/a/a
|
||||
'/api': 'http://192.168.1.187:8080'
|
||||
'/api': ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user