Skip to content

Commit

Permalink
uncomment legacy logic
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 25, 2024
1 parent 73c097e commit 82aba0c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/next/src/build/handle-externals.ts
Expand Up @@ -57,7 +57,7 @@ export async function resolveExternal(
context: string,
request: string,
isEsmRequested: boolean,
optOutBundlingPackages: string[],
_optOutBundlingPackages: string[],
getResolve: (
options: any
) => (
Expand Down Expand Up @@ -276,18 +276,18 @@ export function makeExternalHandler({
// Treat react packages and next internals as external for SSR layer,
// also map react to builtin ones with require-hook.
// Otherwise keep continue the process to resolve the externals.
// if (layer === WEBPACK_LAYERS.serverSideRendering) {
// const isRelative = request.startsWith('.')
// const fullRequest = isRelative
// ? normalizePathSep(path.join(context, request))
// : request

// // Check if it's opt out bundling package first
// if (containsImportInPackages(fullRequest, optOutBundlingPackages)) {
// return fullRequest
// }
// return resolveNextExternal(fullRequest)
// }
if (layer === WEBPACK_LAYERS.serverSideRendering) {
const isRelative = request.startsWith('.')
const fullRequest = isRelative
? normalizePathSep(path.join(context, request))
: request

// Check if it's opt out bundling package first
if (containsImportInPackages(fullRequest, optOutBundlingPackages)) {
return fullRequest
}
return resolveNextExternal(fullRequest)
}

// TODO-APP: Let's avoid this resolve call as much as possible, and eventually get rid of it.
const resolveResult = await resolveExternal(
Expand Down

0 comments on commit 82aba0c

Please sign in to comment.