Skip to content

Commit

Permalink
update main fields for edge
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jun 12, 2023
1 parent cd45430 commit 5015fb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1941,8 +1941,10 @@ export default async function getBaseWebpackConfig(
],
},
resolve: {
// Prefer module fields over main fields for isomorphic packages on server layer
mainFields: ['module', 'main'],
mainFields: isEdgeServer
? mainFieldsPerCompiler[COMPILER_NAMES.edgeServer]
: // Prefer module fields over main fields for isomorphic packages on server layer
['module', 'main'],
conditionNames: reactServerCondition,
alias: {
// If missing the alias override here, the default alias will be used which aliases
Expand Down

0 comments on commit 5015fb2

Please sign in to comment.