Struct nodejs_resolver::ResolverOptions
source · [−]pub struct ResolverOptions {
pub extensions: Vec<String>,
pub enforce_extension: Option<bool>,
pub alias: Vec<(String, AliasMap)>,
pub prefer_relative: bool,
pub unsafe_cache: Option<Arc<ResolverUnsafeCache>>,
pub symlinks: bool,
pub description_file: Option<String>,
pub main_files: Vec<String>,
pub main_fields: Vec<String>,
pub alias_fields: Vec<String>,
pub condition_names: HashSet<String>,
pub tsconfig: Option<PathBuf>,
}
Fields
extensions: Vec<String>
Tried detect file with this extension.
Default is ["js", "json", "node"]
enforce_extension: Option<bool>
Enforce that a extension from extensions must be used.
Default is None
alias: Vec<(String, AliasMap)>
Maps key to value.
None
means that the value is false
.
Default is vec![]
.
The reason for using Vec
instead HashMap
to keep the order.
prefer_relative: bool
Prefer to resolve request as relative request and
fallback to resolving as modules.
Default is false
unsafe_cache: Option<Arc<ResolverUnsafeCache>>
Use of cache defined external, it designed to shared the info of description_file
in different.
- If
unsafe_cache
isNone
, use default cache in resolver. - If
unsafe_cache.is_some()
is true, use this cache.
Default is None
.
symlinks: bool
Whether to resolve the real path when the result
is a symlink.
Default is true
.
description_file: Option<String>
A JSON file to describing this lib information.
Default is Some("package.json")
.
main_files: Vec<String>
Main file in this directory.
Default is ["index"]
.
main_fields: Vec<String>
Main fields in Description.
Default is ["main"]
.
alias_fields: Vec<String>
The list of alias fields in description files.
Default is []
condition_names: HashSet<String>
Condition names for exports filed. Note that its
type is a HashSet
, because the priority is
related to the order in which the export field
fields are written.
Default is Set(["node"])
.
tsconfig: Option<PathBuf>
When this filed exists, it tries to read baseURL
and paths
in the corresponding tsconfig,
and processes the mappings.
Default is None
.
Trait Implementations
sourceimpl Clone for ResolverOptions
impl Clone for ResolverOptions
sourcefn clone(&self) -> ResolverOptions
fn clone(&self) -> ResolverOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ResolverOptions
impl Debug for ResolverOptions
Auto Trait Implementations
impl !RefUnwindSafe for ResolverOptions
impl Send for ResolverOptions
impl Sync for ResolverOptions
impl Unpin for ResolverOptions
impl !UnwindSafe for ResolverOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more