Merge pull request '前端:修复多分支部署时静态资源的路径问题' (#52) from feature-nxdev into main
Reviewed-on: #52
This commit is contained in:
commit
8938dd40d4
@ -1,4 +1,4 @@
|
||||
VITE_API_BASE_URL = http://localhost:5202/api
|
||||
VITE_SIGNALR_BASE_URL = http://localhost:5202/chat
|
||||
#VITE_API_BASE_URL = http://192.168.5.116:7070/api
|
||||
#VITE_SIGNALR_BASE_URL = http://192.168.5.116:7070/chat
|
||||
#VITE_API_BASE_URL = http://localhost:5202/api
|
||||
#VITE_SIGNALR_BASE_URL = http://localhost:5202/chat
|
||||
VITE_API_BASE_URL = https://im.test.nxsir.cn/api
|
||||
VITE_SIGNALR_BASE_URL = https://im.test.nxsir.cn/chat
|
||||
@ -4,9 +4,20 @@ import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
export default defineConfig(( { command } ) => {
|
||||
let branch = process.env.BRANCH || 'main'
|
||||
|
||||
// 1️⃣ dev 模式:永远 /
|
||||
if (command === 'serve') {
|
||||
branch = '/'
|
||||
}else{
|
||||
branch = `/${branch}/`
|
||||
}
|
||||
|
||||
return {
|
||||
base: branch,
|
||||
build: {
|
||||
sourcemap: true
|
||||
},
|
||||
@ -19,4 +30,5 @@ export default defineConfig({
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user