Skip to main content

Crate oxc_resolver

Crate oxc_resolver 

Source
Expand description

§Oxc Resolver

Node.js CommonJS and ECMAScript Module Resolution.

Released on crates.io and npm.

A module resolution is the process of finding the file referenced by a module specifier in import "specifier" or require("specifier").

All configuration options are aligned with webpack’s enhanced-resolve.

§Terminology

§Specifier

For CommonJS modules, the specifier is the string passed to the require function. e.g. "id" in require("id").

For ECMAScript modules, the specifier of an import statement is the string after the from keyword, e.g. 'specifier' in import 'specifier' or import { sep } from 'specifier'. Specifiers are also used in export from statements, and as the argument to an import() expression.

This is also named “request” in some places.

§References:

§Feature flags

§Example

See examples/dir.rs.

Structs§

Cache
Cache implementation used for caching filesystem access.
CachedPath
CompilerOptions
Compiler Options
FileMetadata
Metadata information about a file
FileSystemOs
JSONError
JSON error from serde_json::Error
ProjectReference
Project Reference
Resolution
The final path resolution with optional ?query and #fragment
ResolveContext
Context returned from the ResolverImpl::resolve_with_context API
ResolveOptions
Module Resolution Options
ResolverGeneric
Generic implementation of the resolver, can be configured by the Cache trait
ResolverImpl
Non-generic core of the resolver holding the heavy resolution algorithm.
TsConfig
TsconfigOptions
Tsconfig Options for ResolveOptions::tsconfig

Enums§

AliasValue
Alias Value for ResolveOptions::alias and ResolveOptions::fallback
EnforceExtension
Value for ResolveOptions::enforce_extension
ExtendsField
Value for the “extends” field.
ImportsExportsKind
ModuleType
PackageType
ResolveError
All resolution errors
Restriction
Value for ResolveOptions::restrictions
SideEffects
SpecifierError
Error for ResolveError::Specifier
TsconfigDiscovery
TsconfigReferences
Configuration for TsconfigOptions::references

Traits§

FileSystem
File System abstraction used for ResolverGeneric
PathUtil
Extension trait to add path normalization to std’s Path.

Type Aliases§

Alias
Alias for ResolveOptions::alias and ResolveOptions::fallback
CompilerOptionsPathsMap
ImportsExportsArray
ImportsExportsEntry
ImportsExportsMap
PackageJson
package.json parsed with simd-json (the parsed BorrowedValue borrows the file bytes).
Resolver
Resolver with the current operating system as the file system
","&mut as Index>::Output":"

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A>
where\n A: Allocator,
"," as IntoIterator>::IntoIter":"

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A>
where\n A: Allocator,
"," as IntoDeserializer<'de, E>>::Deserializer":"

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A>
where\n A: Allocator,
","Drain<'_, K, V>":"

Notable traits for Drain<'_, K, V>

impl<K, V> Iterator for Drain<'_, K, V>
type Item = (K, V);
","Drain<'_, T, A>":"

Notable traits for Drain<'_, T, A>

impl<T, A> Iterator for Drain<'_, T, A>
where\n A: Allocator,
type Item = T;
","ExtractIf<'_, K, V, F>":"

Notable traits for ExtractIf<'_, K, V, F>

impl<K, V, F> Iterator for ExtractIf<'_, K, V, F>
where\n F: FnMut(&K, &mut V) -> bool,
type Item = (K, V);
","ExtractIf<'_, T, F, A>":"

Notable traits for ExtractIf<'_, T, F, A>

impl<T, F, A> Iterator for ExtractIf<'_, T, F, A>
where\n A: Allocator,\n F: FnMut(&mut T) -> bool,
type Item = T;
","IntoIter":"

Notable traits for IntoIter<K, V>

impl<K, V> Iterator for IntoIter<K, V>
type Item = (K, V);
","IntoKeys":"

Notable traits for IntoKeys<K, V>

impl<K, V> Iterator for IntoKeys<K, V>
type Item = K;
","IntoValues":"

Notable traits for IntoValues<K, V>

impl<K, V> Iterator for IntoValues<K, V>
type Item = V;
","Iter<'_, K, V>":"

Notable traits for Iter<'a, K, V>

impl<'a, K, V> Iterator for Iter<'a, K, V>
type Item = (&'a K, &'a V);
","IterMut2<'_, as MutableKeys>::Key, as MutableKeys>::Value>":"

Notable traits for IterMut2<'a, K, V>

impl<'a, K, V> Iterator for IterMut2<'a, K, V>
","IterMut<'_, K, V>":"

Notable traits for IterMut<'a, K, V>

impl<'a, K, V> Iterator for IterMut<'a, K, V>
type Item = (&'a K, &'a mut V);
","Keys<'_, K, V>":"

Notable traits for Keys<'a, K, V>

impl<'a, K, V> Iterator for Keys<'a, K, V>
type Item = &'a K;
","Splice<'_, ::IntoIter, A>":"

Notable traits for Splice<'_, I, A>

impl<I, A> Iterator for Splice<'_, I, A>
where\n I: Iterator,\n A: Allocator,
type Item = <I as Iterator>::Item;
","Splice<'_, ::IntoIter, K, V, S>":"

Notable traits for Splice<'_, I, K, V, S>

impl<I, K, V, S> Iterator for Splice<'_, I, K, V, S>
where\n I: Iterator<Item = (K, V)>,\n K: Hash + Eq,\n S: BuildHasher,
type Item = (K, V);
","Values<'_, K, V>":"

Notable traits for Values<'a, K, V>

impl<'a, K, V> Iterator for Values<'a, K, V>
type Item = &'a V;
","ValuesMut<'_, K, V>":"

Notable traits for ValuesMut<'a, K, V>

impl<'a, K, V> Iterator for ValuesMut<'a, K, V>
type Item = &'a mut V;
"}