Skip to content

Commit

Permalink
Add proper deprecation/rename warnings for server bundling option (#6…
Browse files Browse the repository at this point in the history
…5575)

Follow up to #65421

This pr re-adds the old experimental options to the type definition and
adds proper warnings in the config resolver.
  • Loading branch information
Ethan-Arrowood committed May 10, 2024
1 parent 2257133 commit 3c06a50
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/next/src/server/config-shared.ts
Expand Up @@ -446,6 +446,16 @@ export interface ExperimentalConfig {
* Allow NODE_ENV=development even for `next build`.
*/
allowDevelopmentBuild?: true
/**
* @deprecated use `config.bundlePagesRouterDependencies` instead
*
*/
bundlePagesExternals?: boolean
/**
* @deprecated use `config.serverExternalPackages` instead
*
*/
serverComponentsExternalPackages?: string[]
}

export type ExportPathMap = {
Expand Down
14 changes: 14 additions & 0 deletions packages/next/src/server/config.ts
Expand Up @@ -465,6 +465,20 @@ function assignDefaults(
}
}

warnOptionHasBeenMovedOutOfExperimental(
result,
'bundlePagesExternals',
'bundlePagesRouterDependencies',
configFileName,
silent
)
warnOptionHasBeenMovedOutOfExperimental(
result,
'serverComponentsExternalPackages',
'serverExternalPackages',
configFileName,
silent
)
warnOptionHasBeenMovedOutOfExperimental(
result,
'relay',
Expand Down

0 comments on commit 3c06a50

Please sign in to comment.