Skip to content

Commit

Permalink
use provided getResolve
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Dec 22, 2024
1 parent 13107a5 commit cef88d7
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions packages/next/src/build/handle-externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -74,17 +73,7 @@ export async function resolveExternal(

for (const preferEsm of preferEsmOptions) {
const resolveOptions = preferEsm ? esmResolveOptions : nodeResolveOptions

let resolve: ReturnType<typeof getResolve>

// 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
Expand Down

0 comments on commit cef88d7

Please sign in to comment.