Skip to content

Commit

Permalink
Disable built-in css-in-js transform on server layer
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 29, 2022
1 parent 26a23e9 commit 1484b4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/next/build/swc/options.js
Expand Up @@ -109,7 +109,9 @@ function getBaseSWCOptions({
},
},
sourceMaps: jest ? 'inline' : undefined,
styledComponents: getStyledComponentsOptions(nextConfig, development),
styledComponents: isServerLayer
? undefined
: getStyledComponentsOptions(nextConfig, development),
removeConsole: nextConfig?.compiler?.removeConsole,
// disable "reactRemoveProperties" when "jest" is true
// otherwise the setting from next.config.js will be used
Expand All @@ -118,7 +120,9 @@ function getBaseSWCOptions({
: nextConfig?.compiler?.reactRemoveProperties,
modularizeImports: nextConfig?.experimental?.modularizeImports,
relay: nextConfig?.compiler?.relay,
emotion: getEmotionOptions(nextConfig, development),
emotion: isServerLayer
? undefined
: getEmotionOptions(nextConfig, development),
serverComponents: nextConfig?.experimental?.appDir
? {
isServer: !!isServerLayer,
Expand Down

0 comments on commit 1484b4d

Please sign in to comment.