From cef88d7c81078527a121a704829c29aa332b03c1 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Sun, 22 Dec 2024 11:37:24 -0600 Subject: [PATCH] use provided getResolve --- packages/next/src/build/handle-externals.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/next/src/build/handle-externals.ts b/packages/next/src/build/handle-externals.ts index 20817b7095914..4f13c2de30c73 100644 --- a/packages/next/src/build/handle-externals.ts +++ b/packages/next/src/build/handle-externals.ts @@ -62,7 +62,6 @@ export async function resolveExternal( baseEsmResolveOptions: any = NODE_BASE_ESM_RESOLVE_OPTIONS, baseResolveOptions: any = NODE_BASE_RESOLVE_OPTIONS ) { - const isRspack = Boolean(process.env.NEXT_RSPACK) const esmExternals = !!esmExternalsConfig const looseEsmExternals = esmExternalsConfig === 'loose' @@ -74,17 +73,7 @@ export async function resolveExternal( for (const preferEsm of preferEsmOptions) { const resolveOptions = preferEsm ? esmResolveOptions : nodeResolveOptions - - let resolve: ReturnType - - // RSPack doesn't support getResolve yet - if (isRspack) { - // eslint-disable-next-line - const { ResolverFactory } = require('enhanced-resolve') - resolve = ResolverFactory.createResolver(resolveOptions) - } else { - resolve = getResolve(resolveOptions) - } + const resolve = getResolve(resolveOptions) // Resolve the import with the webpack provided context, this // ensures we're resolving the correct version when multiple