Define a custom resolver that resolves a path
The custom resolver function will be used instead of the default import.meta.resolve() for resolving import specifiers.
Function that takes a specifier and returns resolved path
Resolve import specifier to an absolute file path
This method caches resolved paths to improve performance on repeated resolutions. Relative paths are not supported and will throw an error.
The import specifier to resolve (must not be relative)
The resolved absolute file path
Encapsulates the API to resolve import specifiers with the ability to define custom resolver functions.
The PathsResolver provides a caching mechanism to avoid resolving the same specifier multiple times and supports custom resolvers for handling special import patterns like path aliases.
Example