pub struct ResolverOptions {
    pub extensions: Vec<String>,
    pub alias: HashMap<String, Option<String>>,
    pub alias_fields: Vec<String>,
    pub condition_names: HashSet<String>,
    pub symlinks: bool,
    pub description_file: Option<String>,
    pub main_files: Vec<String>,
    pub main_fields: Vec<String>,
    pub modules: Vec<String>,
    pub prefer_relative: bool,
    pub enable_unsafe_cache: bool,
}

Fields

extensions: Vec<String>

Tried detect file with this extension. Default is [“js”, “json”, “node”]

alias: HashMap<String, Option<String>>

Maps key to value. None means that the value is false. Default is HashMap::new().

alias_fields: Vec<String>

The list of alias fields in description files. TODO: currently only support one alias field. 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"]).

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"). It can be set to None when resolve css.

main_files: Vec<String>

Main file in this directory. Default is ["index"].

main_fields: Vec<String>

Main fields in Description. Default is ["main"].

modules: Vec<String>

Directories to resolve module from. Default is ["node_modules"].

prefer_relative: bool

Prefer to resolve request as relative request and fallback to resolveing as modules. Default is false

enable_unsafe_cache: bool

Cache had stored the processed description_file parsing information by default, but the action is not secure, and when you try to modify a description_file, they will still use the data before the modification. Default is true.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.