Merge pull request #9115 from erik-krogh/fileAndFolder

JS: resolve main module when there is a folder with the same name as the main file
This commit is contained in:
Erik Krogh Kristensen
2022-05-12 14:55:28 +02:00
committed by GitHub
5 changed files with 21 additions and 1 deletions

View File

@@ -96,7 +96,7 @@ File resolveMainModule(PackageJson pkg, int priority) {
or
result = tryExtensions(main.resolve(), "index", priority)
or
not exists(main.resolve()) and
not main.resolve() instanceof File and
exists(int n | n = main.getNumComponent() |
result = tryExtensions(main.resolveUpTo(n - 1), getStem(main.getComponent(n - 1)), priority)
)