| 1437 | } |
| 1438 | |
| 1439 | dependenciesOf(id: string): string[] { |
| 1440 | // a Set iterates in insertion order, entries added as it goes included, |
| 1441 | // and a program read whole reaches thousands |
| 1442 | const result = new Set([id]) |
| 1443 | for (const reached of result) { |
| 1444 | for (const dependency of this.importsById[reached] ?? []) |
| 1445 | result.add(dependency) |
| 1446 | } |
| 1447 | return [...result] |
| 1448 | } |
| 1449 | |
| 1450 | // whether an import's module resolves without asking a bundler |
| 1451 | resolvesLocally(binding: Binding, module: SourceModule): boolean { |