Skip to content

Commit 0fc70e0

Browse files
authored
fix: exclude plugin-cloud-storage, plugin-sentry and plugin-stripe from bundling optimization (#11673)
Since those packages have `/client` exports, we cannot exclude them from the bundler until vercel/next.js#76991 is implemented. Fixes #11594 (comment)
1 parent 355bd12 commit 0fc70e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/next/src/withPayload.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const withPayload = (nextConfig = {}, options = {}) => {
102102
'pino-pretty',
103103
'graphql',
104104
// Do not bundle server-only packages during dev to improve compile speed
105-
...(process.env.npm_lifecycle_event === 'dev' && options.devBundleServerPackages === false
105+
...(process.env.NODE_ENV === 'development' && options.devBundleServerPackages === false
106106
? [
107107
'payload',
108108
'@payloadcms/db-mongodb',
@@ -114,11 +114,11 @@ export const withPayload = (nextConfig = {}, options = {}) => {
114114
'@payloadcms/email-resend',
115115
'@payloadcms/graphql',
116116
'@payloadcms/payload-cloud',
117-
'@payloadcms/plugin-cloud-storage',
118117
'@payloadcms/plugin-redirects',
119-
'@payloadcms/plugin-sentry',
120-
'@payloadcms/plugin-stripe',
121118
// TODO: Add the following packages, excluding their /client subpath exports, once Next.js supports it
119+
//'@payloadcms/plugin-cloud-storage',
120+
//'@payloadcms/plugin-sentry',
121+
//'@payloadcms/plugin-stripe',
122122
// @payloadcms/richtext-lexical
123123
//'@payloadcms/storage-azure',
124124
//'@payloadcms/storage-gcs',

0 commit comments

Comments
 (0)