fix(web): turbopack config dev-only (prod build compat)
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:
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user