diff --git a/packages/ice/src/utils/getRouterBasename.ts b/packages/ice/src/utils/getRouterBasename.ts index 32482fdfa..716e8bb5e 100644 --- a/packages/ice/src/utils/getRouterBasename.ts +++ b/packages/ice/src/utils/getRouterBasename.ts @@ -3,7 +3,7 @@ import type { Config } from '@ice/types'; import type { TaskConfig } from 'build-scripts'; const getRouterBasename = (taskConfig: TaskConfig, appConfig: AppConfig) => { - return taskConfig?.config?.basename || appConfig?.router?.basename; + return appConfig?.router?.basename ?? taskConfig?.config?.basename ?? ''; }; export default getRouterBasename; diff --git a/packages/ice/templates/core/entry.client.ts.ejs b/packages/ice/templates/core/entry.client.ts.ejs index 8e1c90285..14f5fb191 100644 --- a/packages/ice/templates/core/entry.client.ts.ejs +++ b/packages/ice/templates/core/entry.client.ts.ejs @@ -6,7 +6,7 @@ import Document from '@/document'; const getRouterBasename = () => { const appConfig = getAppConfig(app); - return '<%- basename %>' || appConfig?.router?.basename || ''; + return appConfig?.router?.basename ?? '<%- basename %>' ?? ''; } runClientApp({ diff --git a/packages/ice/templates/core/entry.server.ts.ejs b/packages/ice/templates/core/entry.server.ts.ejs index 0b8cedcb9..86ea77594 100644 --- a/packages/ice/templates/core/entry.server.ts.ejs +++ b/packages/ice/templates/core/entry.server.ts.ejs @@ -9,7 +9,7 @@ import routes from './routes'; const getRouterBasename = () => { const appConfig = runtime.getAppConfig(app); - return '<%- basename %>' || appConfig?.router?.basename || ''; + return appConfig?.router?.basename ?? '<%- basename %>' ?? ''; } const setRuntimeEnv = (renderMode) => {