fix(web): turbopack config dev-only (prod build compat)
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

Next.js 16.0.10 fails production builds with turbopack config
present (needs >=16.1.0). Gate it behind NODE_ENV !== production.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-06 00:41:38 +01:00
parent 8fca7fb21a
commit 253e0ac43c

View File

@@ -82,14 +82,21 @@ const config: NextConfig = {
"better-sqlite3",
"@mapbox/node-pre-gyp",
],
turbopack: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
},
// turbopack config moved to dev-only — Next.js 16.0.10 doesn't
// support turbopack for production builds (needs >=16.1.0).
// SVG loading via @svgr/webpack works via the webpack config below.
...(process.env.NODE_ENV !== "production"
? {
turbopack: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
},
}
: {}),
images: {
remotePatterns: [