fix(web): add webpack SVG loader (TURBOPACK=0 prod builds)
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

turbopack.rules only applies to turbopack. When building with
TURBOPACK=0 (required for Payload CMS), webpack has no SVG rule.
Icons.UnitedKingdom returns an object → React #130. Adding a
webpack config rule for @svgr/webpack fixes both bundler paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-09 12:43:44 +01:00
parent 8d1685e64d
commit 17066b4f6c

View File

@@ -102,6 +102,15 @@ const config: NextConfig = {
}, },
}, },
// Webpack SVG loader (used when TURBOPACK=0 for production builds)
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
return config;
},
images: { images: {
remotePatterns: [ remotePatterns: [
{ {