添加环境配置文件,更新 Vite 配置以支持本地代理,优化 AppCard 组件的懒加载逻辑

This commit is contained in:
Elysia
2026-01-17 21:00:21 +08:00
parent a5b3d1278c
commit 0d16434374
9 changed files with 96 additions and 99 deletions

View File

@@ -62,13 +62,33 @@ export default defineConfig(({ command }) => {
renderer: {},
}),
],
server: process.env.VSCODE_DEBUG && (() => {
const url = new URL(pkg.debug.env.VITE_DEV_SERVER_URL)
return {
host: url.hostname,
port: +url.port,
server: (() => {
if (process.env.VSCODE_DEBUG) {
const url = new URL(pkg.debug.env.VITE_DEV_SERVER_URL);
return {
host: url.hostname,
port: +url.port,
proxy: {
'/local_amd64-apm': {
target: 'https://erotica.spark-app.store',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local_amd64-apm/, ''),
}
}
}
} else {
return {
proxy: {
'/local_amd64-apm': {
target: 'https://erotica.spark-app.store',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local_amd64-apm/, ''),
}
}
}
}
})(),
}
)(),
clearScreen: false,
}
})