modify project display

This commit is contained in:
csh
2024-08-26 22:26:28 +08:00
parent 32c3d43d9a
commit 54ac45fdab
3 changed files with 133 additions and 31 deletions

View File

@@ -24,7 +24,13 @@ export default ({ mode }: ConfigEnv): UserConfigExport => {
port: VITE_PORT,
host: "0.0.0.0",
// 本地跨域代理 https://cn.vitejs.dev/config/server-options.html#server-proxy
proxy: {},
proxy: {
"/project/api": {
target: "http://localhost:8866",
changeOrigin: true,
rewrite: path => path.replace(/^\/project\/api/, "")
}
},
// 预热文件以提前转换和缓存结果,降低启动期间的初始页面加载时长并防止转换瀑布
warmup: {
clientFiles: ["./index.html", "./src/{views,components}/*"]