Expand description
Import specifier resolution using oxc_resolver.
Orchestrates the resolution pipeline: for every extracted module, resolves all
import specifiers in parallel (via rayon) to an ResolveResult — internal file,
npm package, external file, or unresolvable. The entry point is resolve_all_imports.
Resolution is split into submodules by import kind:
static_imports— ESimportdeclarationsdynamic_imports—import()expressions and glob-based dynamic patternsrequire_imports— CommonJSrequire()callsre_exports—export { x } from './y're-export sourcesupgrades— post-resolution pass fixing non-deterministic bare specifier results
Handles tsconfig path aliases (auto-discovered per file), pnpm virtual store paths,
React Native platform extensions, and package.json exports subpath resolution with
output-to-source directory fallback.
Structs§
- Resolved
Import - A resolved import with its target.
- Resolved
Module - Fully resolved module with all imports mapped to targets.
- Resolved
ReExport - A resolved re-export with its target.
Enums§
- Resolve
Result - Result of resolving an import specifier.
Functions§
- extract_
package_ name - Extract the npm package name from a specifier.
@scope/pkg/foo/bar->@scope/pkglodash/merge->lodash - is_
bare_ specifier - Check if a specifier is a bare specifier (npm package or Node.js imports map entry).
- is_
path_ alias - Check if a bare specifier looks like a path alias rather than an npm package.
- resolve_
all_ imports - Resolve all imports across all modules in parallel.