Files
bun.sh/test/regression
Claude Bot 9ddc74540a Fix module resolution: '.' in subdirectory resolves to index.ts
Previously, importing '.' or './' from within a subdirectory would
incorrectly resolve to a file with the same name in the parent
directory, rather than the index file in the current directory.

For example, importing from 'lib/run.ts':
```ts
import { foo } from ".";
```

Would incorrectly resolve to the root 'lib.ts' instead of 'lib/index.ts'.

This fix adds a check in loadAsFile() to detect when the path being
resolved is actually a directory. If the basename has no extension
(indicating it's likely a directory reference), we check if it exists
as a directory before attempting file resolution. This ensures directory
imports correctly fall through to index file resolution.

Fixes #24449

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 13:15:36 +00:00
..