Skip to content

Commit

Permalink
fix: false positive needsInterop
Browse files Browse the repository at this point in the history
  • Loading branch information
Mesteery committed Jul 18, 2021
1 parent e47a6f2 commit 1bfa1c5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,10 @@ function needsInterop(
// ESM dependency's entry chunk into a single default export... detect
// such cases by checking exports mismatch, and force interop.
const flatId = flattenId(id) + '.js'
const cachePath = normalizePath(path.join(cacheDirOutputPath, flatId))
let generatedExports: string[] | undefined
for (const output in outputs) {
if (
normalizePath(output) ===
normalizePath(path.join(cacheDirOutputPath, flatId))
) {
if (normalizePath(path.relative(process.cwd(), output)) === cachePath) {
generatedExports = outputs[output].exports
break
}
Expand Down

0 comments on commit 1bfa1c5

Please sign in to comment.