From ce82c60da368429c25f32cad63b683f8e5679036 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 19 Sep 2022 16:29:56 +0200 Subject: [PATCH] Incldue styled-jsx in swc compiling (#40679) 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 --- packages/next/build/webpack-config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 5dc9e5d7d543..6aaa9ceeccae 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -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