mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 09:20:18 +08:00
添加环境配置文件,更新 Vite 配置以支持本地代理,优化 AppCard 组件的懒加载逻辑
This commit is contained in:
@@ -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,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user