Skip to content

Commit dcecc46

Browse files
authored
fix(next): merge user serverExternalPackages in withPayload (#14881)
Merge user's `serverExternalPackages` with Payload's defaults in `withPayload()`. Currently user-defined `serverExternalPackages` are ignored: ```js const nextConfig = { serverExternalPackages: ['@node-rs/xxhash', 'prettier'], // ignored } export default withPayload(nextConfig) ``` Fix: spread user packages before Payload's defaults.
1 parent 92dcb83 commit dcecc46

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/next/src/withPayload/withPayload.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const withPayload = (
8181
]
8282
},
8383
serverExternalPackages: [
84+
...(nextConfig.serverExternalPackages || []),
8485
// WHY: without externalizing graphql, a graphql version error will be thrown
8586
// during runtime ("Ensure that there is only one instance of \"graphql\" in the node_modules\ndirectory.")
8687
'graphql',

0 commit comments

Comments
 (0)