diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index d4cc7be9e538e..b26cd03b8d52d 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -824,7 +824,7 @@ export default async function getBaseWebpackConfig( // Alias the usage of next public APIs [path.join(NEXT_PROJECT_ROOT, 'server')]: 'next/dist/esm/server/web/exports/index', - [path.join(NEXT_PROJECT_ROOT, 'dist', 'client', 'link')]: + [path.join(NEXT_PROJECT_ROOT_DIST, 'client', 'link')]: 'next/dist/esm/client/link', [path.join( NEXT_PROJECT_ROOT, @@ -833,28 +833,26 @@ export default async function getBaseWebpackConfig( 'lib', 'image-external' )]: 'next/dist/esm/shared/lib/image-external', - [path.join(NEXT_PROJECT_ROOT, 'dist', 'client', 'script')]: + [path.join(NEXT_PROJECT_ROOT_DIST, 'client', 'script')]: 'next/dist/esm/client/script', - [path.join(NEXT_PROJECT_ROOT, 'dist', 'client', 'router')]: + [path.join(NEXT_PROJECT_ROOT_DIST, 'client', 'router')]: 'next/dist/esm/client/router', - [path.join(NEXT_PROJECT_ROOT, 'dist', 'shared', 'lib', 'head')]: + [path.join(NEXT_PROJECT_ROOT_DIST, 'shared', 'lib', 'head')]: 'next/dist/esm/shared/lib/head', - [path.join(NEXT_PROJECT_ROOT, 'dist', 'shared', 'lib', 'dynamic')]: + [path.join(NEXT_PROJECT_ROOT_DIST, 'shared', 'lib', 'dynamic')]: 'next/dist/esm/shared/lib/dynamic', - [path.join(NEXT_PROJECT_ROOT, 'dist', 'pages', '_document')]: + [path.join(NEXT_PROJECT_ROOT_DIST, 'pages', '_document')]: 'next/dist/esm/pages/_document', - [path.join(NEXT_PROJECT_ROOT, 'dist', 'pages', '_app')]: + [path.join(NEXT_PROJECT_ROOT_DIST, 'pages', '_app')]: 'next/dist/esm/pages/_app', [path.join( - NEXT_PROJECT_ROOT, - 'dist', + NEXT_PROJECT_ROOT_DIST, 'client', 'components', 'navigation' )]: 'next/dist/esm/client/components/navigation', [path.join( - NEXT_PROJECT_ROOT, - 'dist', + NEXT_PROJECT_ROOT_DIST, 'client', 'components', 'headers'