Skip to content

Commit

Permalink
Incldue styled-jsx in swc compiling (#40679)
Browse files Browse the repository at this point in the history
Tree share the `typeof window` conditions in styled-jsx for edge runtime. Let swc loader go through the styled-jsx assets under node_modules, applying the optimization as well

`test-app/server/edge-ssr.js` -155B
  • Loading branch information
huozhi committed Sep 19, 2022
1 parent 44afc37 commit ce82c60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/next/build/webpack-config.ts
Expand Up @@ -693,6 +693,7 @@ export default async function getBaseWebpackConfig(
/next[\\/]dist[\\/]client/,
/next[\\/]dist[\\/]pages/,
/[\\/](strip-ansi|ansi-regex)[\\/]/,
/styled-jsx[\\/]/,
]

// Support for NODE_PATH
Expand Down

0 comments on commit ce82c60

Please sign in to comment.