Skip to content

@saflib/imports


src/resolve

Functions

FunctionDescription
buildPackageIndexBuild a map of workspace package name → { dir, exports }. Scans the tree (SAF layout); does not depend on @saflib/dev-tools.
existsResolveResolve a path candidate with common TS/Vue extensions and index files.
externalRootnpm package root for a bare specifier (stripe, @scope/pkg).
findMonorepoRootWalk up from fromDir until a package.json with a workspaces field is found.
resolvePackageExportPathResolve a package export subpath to an absolute file path (no extension probing).
resolveSpecifierResolve an import specifier relative to fromFile against the package index. Returns a workspace file, an external root, or null (unresolved relative).

References

matchExportPattern

Re-exports matchExportPattern


sortExportPatternKeys

Re-exports sortExportPatternKeys