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:
Alejandro Gutiérrez
2026-04-13 09:24:32 +01:00
parent 465ff9a10e
commit 80a6b8b50f
3 changed files with 7 additions and 31 deletions

View File

@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"build": "next build --webpack",
"build": "NODE_OPTIONS='--experimental-loader ./css-stub-loader.mjs' next build --webpack",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"dev": "next dev",
"format": "prettier --check . --ignore-path ../../.gitignore",