Skip to content

Commit

Permalink
fix: compat for package entries without extension
Browse files Browse the repository at this point in the history
close #284
  • Loading branch information
yyx990803 committed May 28, 2020
1 parent 9ac63b1 commit 6269b7f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ export function resolveNodeModule(
// be passed to resolveNodeModuleFile().
let entryFilePath: string | null = null
if (entryPoint) {
// #284 some packages specify entry without extension...
if (!path.extname(entryPoint)) {
entryPoint += '.js'
}
entryFilePath = path.join(path.dirname(pkgPath), entryPoint!)
entryPoint = path.posix.join(id, entryPoint!)
// save the resolved file path now so we don't need to do it again in
Expand Down

0 comments on commit 6269b7f

Please sign in to comment.