From a244dcd2614b68283b7e0cf0d283c763a851bc89 Mon Sep 17 00:00:00 2001 From: k1ngbanana <32843518+k1ngbanana@users.noreply.github.com> Date: Fri, 8 Sep 2023 22:10:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B7=AF=E5=BE=84=E6=97=A0=E6=95=88=20(#3007?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/vite-config/src/config/application.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/vite-config/src/config/application.ts b/internal/vite-config/src/config/application.ts index 4b3294277..b6c07d4b8 100644 --- a/internal/vite-config/src/config/application.ts +++ b/internal/vite-config/src/config/application.ts @@ -21,7 +21,10 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) { return defineConfig(async ({ command, mode }) => { const root = process.cwd(); const isBuild = command === 'build'; - const { VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_ENABLE_ANALYZE } = loadEnv(mode, root); + const { VITE_PUBLIC_PATH, VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_ENABLE_ANALYZE } = loadEnv( + mode, + root, + ); const defineData = await createDefineData(root); const plugins = await createPlugins({ @@ -35,6 +38,7 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) { const pathResolve = (pathname: string) => resolve(root, '.', pathname); const applicationConfig: UserConfig = { + base: VITE_PUBLIC_PATH, resolve: { alias: [ {