Skip to content

Commit

Permalink
fix: import Interop for esm
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 13, 2021
1 parent 6a3f0d1 commit 3510500
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export function resolveModule(name, options) {
}

export function importModule(path) {
return import(path)
return import(path).then((i) => {
if (i && i.default && i.default.__esModule)
return i.default
return i
})
}

export function isPackageExists(name, options) {
Expand Down

0 comments on commit 3510500

Please sign in to comment.