Skip to content

Commit

Permalink
chore: update add subPath
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyingchun committed Aug 2, 2024
1 parent 3297b6a commit 491fb6c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
10 changes: 5 additions & 5 deletions apps/docs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function Home() {
<main className={styles.main}>
<Image
className={styles.logo}
src="/next.svg"
src="/docs/next.svg"
alt="Next.js logo"
width={180}
height={38}
Expand All @@ -30,7 +30,7 @@ export default function Home() {
>
<Image
className={styles.logo}
src="/vercel.svg"
src="/docs/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
Expand All @@ -56,7 +56,7 @@ export default function Home() {
>
<Image
aria-hidden
src="/file-text.svg"
src="/docs/file-text.svg"
alt="File icon"
width={16}
height={16}
Expand All @@ -70,7 +70,7 @@ export default function Home() {
>
<Image
aria-hidden
src="/window.svg"
src="/docs/window.svg"
alt="Window icon"
width={16}
height={16}
Expand All @@ -84,7 +84,7 @@ export default function Home() {
>
<Image
aria-hidden
src="/globe.svg"
src="/docs/globe.svg"
alt="Globe icon"
width={16}
height={16}
Expand Down
16 changes: 6 additions & 10 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PHASE_PRODUCTION_BUILD } from 'next/constants.js';
import withNextIntl from 'next-intl/plugin';
import { codeInspectorPlugin } from 'code-inspector-plugin';
import { z } from 'zod';
Expand Down Expand Up @@ -35,6 +34,7 @@ const buildEnv = getNextConfigEnv(
*/
const config = {
reactStrictMode: true,
basePath: '/web',
output: buildEnv.NEXT_BUILD_ENV_OUTPUT,
webpack(config) {
if (isDev) {
Expand All @@ -51,12 +51,8 @@ const config = {
},
};

export default (phase) => {
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,
})
);
7 changes: 6 additions & 1 deletion apps/web/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};

0 comments on commit 491fb6c

Please sign in to comment.