fix(web): add webpack SVG loader (TURBOPACK=0 prod builds)
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:
@@ -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: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user