fix(web): resolve Payload CMS build error with Node.js ESM loader
Payload CMS imports .css/.scss/.svg files that Node.js ESM can't handle during page data collection. Added a custom ESM loader that stubs these asset imports, fixing the build that has been broken since the upgrade. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,7 +90,6 @@ const config: NextConfig = {
|
||||
"@payloadcms/richtext-lexical",
|
||||
"@payloadcms/next",
|
||||
"@payloadcms/ui",
|
||||
"react-image-crop",
|
||||
"sharp",
|
||||
"libsodium-wrappers",
|
||||
],
|
||||
@@ -130,7 +129,7 @@ const config: NextConfig = {
|
||||
},
|
||||
|
||||
/** Enables hot reloading for local packages without a build step */
|
||||
transpilePackages: INTERNAL_PACKAGES,
|
||||
transpilePackages: [...INTERNAL_PACKAGES, "react-image-crop"],
|
||||
experimental: {
|
||||
optimizePackageImports: INTERNAL_PACKAGES,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user