Skip to content

Commit

Permalink
Handle on-demand entries and error overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Jul 10, 2022
1 parent ce2a044 commit 5a5443f
Show file tree
Hide file tree
Showing 11 changed files with 591 additions and 506 deletions.
32 changes: 22 additions & 10 deletions packages/next/build/webpack-config.ts
Expand Up @@ -571,17 +571,29 @@ export default async function getBaseWebpackConfig(
.replace(/\\/g, '/'),
...(config.experimental.appDir
? {
[CLIENT_STATIC_FILES_RUNTIME_MAIN_ROOT]:
`./` +
path
.relative(
dir,
path.join(
NEXT_PROJECT_ROOT_DIST_CLIENT,
dev ? 'app-next-dev.js' : 'app-next.js'
[CLIENT_STATIC_FILES_RUNTIME_MAIN_ROOT]: dev
? [
require.resolve(
`next/dist/compiled/@next/react-refresh-utils/dist/runtime`
),
`./` +
path
.relative(
dir,
path.join(
NEXT_PROJECT_ROOT_DIST_CLIENT,
'app-next-dev.js'
)
)
.replace(/\\/g, '/'),
]
: `./` +
path
.relative(
dir,
path.join(NEXT_PROJECT_ROOT_DIST_CLIENT, 'app-next.js')
)
)
.replace(/\\/g, '/'),
.replace(/\\/g, '/'),
}
: {}),
} as ClientEntries)
Expand Down
6 changes: 6 additions & 0 deletions packages/next/build/webpack/loaders/next-app-loader.ts
Expand Up @@ -140,6 +140,12 @@ const nextAppLoader: webpack.LoaderDefinitionFunction<{
export const AppRouter = require('next/dist/client/components/app-router.client.js').default
export const LayoutRouter = require('next/dist/client/components/layout-router.client.js').default
export const HotReloader = ${
// Disable HotReloader component in production
this.mode === 'development'
? `require('next/dist/client/components/hot-reloader.client.js').default`
: 'null'
}
export const hooksClientContext = require('next/dist/client/components/hooks-client-context.js')
export const __next_app_webpack_require__ = __webpack_require__
Expand Down

0 comments on commit 5a5443f

Please sign in to comment.