From e84fdf13fa61902fcf1ff76b5845747d1b9cc66d Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 5 Nov 2024 22:56:36 +0800 Subject: [PATCH] chore: update frontend build options --- frontend/web/vite.config.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/web/vite.config.ts b/frontend/web/vite.config.ts index eff5cfe5..02bc4836 100644 --- a/frontend/web/vite.config.ts +++ b/frontend/web/vite.config.ts @@ -2,11 +2,7 @@ import react from "@vitejs/plugin-react-swc"; import { resolve } from "path"; import { defineConfig } from "vite"; -let devProxyServer = "http://localhost:8082/"; -if (process.env.DEV_PROXY_SERVER && process.env.DEV_PROXY_SERVER.length > 0) { - console.log("Use devProxyServer from environment: ", process.env.DEV_PROXY_SERVER); - devProxyServer = process.env.DEV_PROXY_SERVER; -} +const devProxyServer = "http://localhost:8082/"; // https://vitejs.dev/config/ export default defineConfig({ @@ -30,4 +26,13 @@ export default defineConfig({ "@/": `${resolve(__dirname, "src")}/`, }, }, + build: { + rollupOptions: { + output: { + entryFileNames: "app.[hash].js", + chunkFileNames: "assets/chunk-vendors.[hash].js", + assetFileNames: "assets/[name].[hash][extname]", + }, + }, + }, });