From 8dd1e3c34f4633f8fae7f3ade0513b6c6c1f1822 Mon Sep 17 00:00:00 2001 From: hsueh chiahao Date: Fri, 26 Sep 2025 18:14:53 +0800 Subject: [PATCH] fix base url --- products/react-apps/alisurvey/src/main.tsx | 2 +- products/react-apps/alisurvey/vite.config.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/products/react-apps/alisurvey/src/main.tsx b/products/react-apps/alisurvey/src/main.tsx index 02cfda4..7c17b04 100644 --- a/products/react-apps/alisurvey/src/main.tsx +++ b/products/react-apps/alisurvey/src/main.tsx @@ -7,7 +7,7 @@ import "./index.css"; createRoot(document.getElementById("root")!).render( - + diff --git a/products/react-apps/alisurvey/vite.config.ts b/products/react-apps/alisurvey/vite.config.ts index dcb1d23..d021b93 100644 --- a/products/react-apps/alisurvey/vite.config.ts +++ b/products/react-apps/alisurvey/vite.config.ts @@ -11,7 +11,11 @@ function getPlugins() { return plugins; } -export default defineConfig({ + + +export default defineConfig(({ command }) => ({ plugins: getPlugins(), - base: '/alisurvey', -}); + base: command === 'build' + ? '/wp-content/products/react-apps/alisurvey/' + : '/alisurvey' +})); \ No newline at end of file