ffdeptree
ffdeptree copied to clipboard
Issue: Does not resolve imports via index.ts exports
Description
ffdeptree fails to resolve imports when they rely on re-exports via an index.ts file — particularly when using export { ... as default } or other re-export styles. It works fine when importing directly from the file, but not when the symbol is re-exported and then imported indirectly.
steps to reproduce
File structure:
root/
├── folderA/
│ └── index.ts
├── folderB/
│ ├── add.ts
│ └── index.ts
Contents:
folderB/add.ts
const add = (a: number, b: number) => {
return a + b;
}
export default add
folderB/index.ts
export { add as default } from './add';
folderA/index.ts
import { add } from '../folderB'; // ❌ This fails
// import { add } from '../folderB/add.ts'; // ✅ This works