From 491fb6c432ae493af21893b575de41eb02793f0b Mon Sep 17 00:00:00 2001 From: tianyingchun Date: Fri, 2 Aug 2024 11:40:48 +0800 Subject: [PATCH] chore: update add `subPath` --- apps/docs/src/app/page.tsx | 10 +++++----- apps/web/next.config.mjs | 16 ++++++---------- apps/web/src/middleware.ts | 7 ++++++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/apps/docs/src/app/page.tsx b/apps/docs/src/app/page.tsx index 8ea47c7..c06f664 100644 --- a/apps/docs/src/app/page.tsx +++ b/apps/docs/src/app/page.tsx @@ -8,7 +8,7 @@ export default function Home() {
Next.js logo Vercel logomark File icon Window icon Globe icon { - const isProd = phase === PHASE_PRODUCTION_BUILD; - return getNextConfig( - plugins.reduce((config, plugin) => plugin(config), { - ...config, - basePath: isProd ? '/web' : '', - }) - ); -}; +export default getNextConfig( + plugins.reduce((config, plugin) => plugin(config), { + ...config, + }) +); diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index ee7f2ad..b6d1250 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -17,6 +17,11 @@ export default function middleware(req: NextRequest) { export const config = { // Skip all paths that should not be internationalized - matcher: ['/((?!api|_next|.*\\..*).*)'], + matcher: [ + // This entry handles the root of the base + // path and should always be included + '/', + '/((?!api|_next|.*\\..*).*)', + ], runtime: 'nodejs', };