diff --git a/src/rollup/plugins/externals.ts b/src/rollup/plugins/externals.ts index ad6326a103..95bf94711e 100644 --- a/src/rollup/plugins/externals.ts +++ b/src/rollup/plugins/externals.ts @@ -166,14 +166,14 @@ export function externals(opts: NodeExternalsOptions): Plugin { // Absolute path, we are not sure about subpath to generate import statement // Guess as main subpath export const packageEntry = await _resolve(pkgName).catch(() => null); - if (packageEntry !== originalId) { + if (packageEntry !== id) { // Reverse engineer subpath export const guessedSubpath: string | null | undefined = - await lookupNodeModuleSubpath(originalId).catch(() => null); + await lookupNodeModuleSubpath(id).catch(() => null); const resolvedGuess = guessedSubpath && (await _resolve(join(pkgName, guessedSubpath)).catch(() => null)); - if (resolvedGuess === originalId) { + if (resolvedGuess === id) { trackedExternals.add(resolvedGuess); return { id: join(pkgName, guessedSubpath!),