Skip to main content

is_path_alias

Function is_path_alias 

Source
pub fn is_path_alias(specifier: &str) -> bool
Expand description

Check if a bare specifier looks like a path alias rather than an npm package.

Path aliases (e.g., @/components, ~/lib, #internal, ~~/utils) are resolved via tsconfig.json paths or package.json imports. They should not be cached (resolution depends on the importing file’s tsconfig context) and should return Unresolvable (not NpmPackage) when resolution fails.