Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Sep 26, 2022
1 parent 938003c commit 4ae35c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1510,6 +1510,7 @@ export default async function getBaseWebpackConfig(
issuerLayer: WEBPACK_LAYERS.server,
test: (req: string) => {
if (
!/\.m?js/.test(req) ||
config.experimental.optoutServerComponentsBundle?.some(
(mod) => {
return req.includes('/node_modules/' + mod + '/')
Expand All @@ -1522,14 +1523,14 @@ export default async function getBaseWebpackConfig(
},
resolve: process.env.__NEXT_REACT_CHANNEL
? {
conditionNames: ['react-server'],
conditionNames: ['react-server', 'node', 'require'],
alias: {
react: `react-${process.env.__NEXT_REACT_CHANNEL}`,
'react-dom': `react-dom-${process.env.__NEXT_REACT_CHANNEL}`,
},
}
: {
conditionNames: ['react-server'],
conditionNames: ['react-server', 'node', 'require'],
alias: {
// If missing the alias override here, the default alias will be used which aliases
// react to the direct file path, not the package name. In that case the condition
Expand Down

0 comments on commit 4ae35c8

Please sign in to comment.