Skip to content

Commit

Permalink
shortcut styled-jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
feedthejim committed Oct 2, 2023
1 parent 218adc5 commit 3ac1a34
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/next/src/build/handle-externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,8 @@ export function makeExternalHandler({
return resolveResult.localRes
}

// Forcedly resolve the styled-jsx installed by next.js,
// since `resolveExternal` cannot find the styled-jsx dep with pnpm
if (request === 'styled-jsx/style') {
resolveResult.res = defaultOverrides['styled-jsx/style']
if (request === 'styled-jsx/style' && !isAppLayer) {
return `commonjs ${defaultOverrides['styled-jsx/style']}`
}

const { res, isEsm } = resolveResult
Expand Down

0 comments on commit 3ac1a34

Please sign in to comment.