Skip to content

Commit

Permalink
Stop using edge condition names as main fields
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 13, 2024
1 parent 8c249e2 commit d898b77
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/next/src/build/webpack-config-rules/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ export const edgeConditionNames = [
'...',
]

const mainFieldsPerCompiler: Record<
CompilerNameValues | 'server-esm',
string[]
> = {
const mainFieldsPerCompiler = {
// For default case, prefer CJS over ESM on server side. e.g. pages dir SSR
[COMPILER_NAMES.server]: ['main', 'module'],
[COMPILER_NAMES.client]: ['browser', 'module', 'main'],
[COMPILER_NAMES.edgeServer]: edgeConditionNames,
// For bundling-all strategy, prefer ESM over CJS
'server-esm': ['module', 'main'],
}
Expand Down

0 comments on commit d898b77

Please sign in to comment.