Skip to content

Commit

Permalink
Merge pull request #6 from tujoworker/fix/double-ext
Browse files Browse the repository at this point in the history
fix: fix double ext issue when both directory and file exists
  • Loading branch information
tujoworker authored Jan 18, 2022
2 parents 0361b18 + d5ea4e4 commit ecec55d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 0 additions & 5 deletions babel-plugin-fully-specified/__tests__/artifacts/module.d.ts

This file was deleted.

8 changes: 7 additions & 1 deletion babel-plugin-fully-specified/babel-plugin-fully-specified.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ function evaluateTargetModule({
return false
}

if (isDirectory && !existsSync(resolve(srcDir, module + srcExt))) {
if (
isDirectory &&
!(
existsSync(resolve(srcDir, module)) &&
existsSync(resolve(srcDir, module + esExtensionDefault))
)
) {
module = `${module}/index`
}

Expand Down

0 comments on commit ecec55d

Please sign in to comment.