Skip to content

Commit

Permalink
Remove redundant condition (#51070)
Browse files Browse the repository at this point in the history
This review comment was sent after merging the PR: #51067 (comment)

The layer condition doesn't do anything if `hasServerComponents` is disabled.
  • Loading branch information
shuding committed Jun 10, 2023
1 parent 41d92fe commit 2ede835
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,7 @@ export default async function getBaseWebpackConfig(
// for middleware to tree shake the unused default optimized imports like "next/server".
// This will cause some performance overhead but
// acceptable as Babel will not be recommended.
[
getSwcLoader({ hasServerComponents: false, isServerLayer: false }),
getBabelLoader(),
]
[getSwcLoader({ hasServerComponents: false }), getBabelLoader()]

// Loader for API routes needs to be differently configured as it shouldn't
// have RSC transpiler enabled, so syntax checks such as invalid imports won't
Expand Down

0 comments on commit 2ede835

Please sign in to comment.