Unverified Commit f3ae3953 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update default for appDocumentPreloading config for minimalMode (#49952)

This config shouldn't be needed in minimal mode as code is evaluated
just-in-time
parent 20db2f3b
...@@ -660,7 +660,7 @@ export const defaultConfig: NextConfig = { ...@@ -660,7 +660,7 @@ export const defaultConfig: NextConfig = {
output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined, output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined,
modularizeImports: undefined, modularizeImports: undefined,
experimental: { experimental: {
appDocumentPreloading: true, appDocumentPreloading: undefined,
clientRouterFilter: false, clientRouterFilter: false,
clientRouterFilterRedirects: false, clientRouterFilterRedirects: false,
fetchCacheKeyPrefix: '', fetchCacheKeyPrefix: '',
......
...@@ -240,7 +240,14 @@ export default class NextNodeServer extends BaseServer { ...@@ -240,7 +240,14 @@ export default class NextNodeServer extends BaseServer {
this.imageResponseCache = new ResponseCache(this.minimalMode) this.imageResponseCache = new ResponseCache(this.minimalMode)
} }
if (!options.dev && !this.nextConfig.experimental.appDocumentPreloading) { const { appDocumentPreloading } = this.nextConfig.experimental
const isDefaultEnabled = typeof appDocumentPreloading === 'undefined'
if (
!options.dev &&
(appDocumentPreloading === true ||
!(this.minimalMode && isDefaultEnabled))
) {
// pre-warm _document and _app as these will be // pre-warm _document and _app as these will be
// needed for most requests // needed for most requests
loadComponents({ loadComponents({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment