Struct import_map::ImportMapOptions
source · pub struct ImportMapOptions {
pub address_hook: Option<Box<dyn Fn(&str, &str, Option<&str>) -> String>>,
pub expand_imports: bool,
}
Fields§
§address_hook: Option<Box<dyn Fn(&str, &str, Option<&str>) -> String>>
(parsed_address, key, maybe_scope) -> new_address
expand_imports: bool
Whether to expand imports in the import map.
This functionality can be used to modify the import map
during parsing, by changing the imports
mapping to expand
bare specifier imports to provide “directory” imports, eg.:
"express": "npm:express@4
->"express/": "npm:/express@4/
"@std": "jsr:@std
->"std@/": "jsr:/@std/
Only npm:
and jsr:
schemes are expanded and if there’s already a
“directory” import, it is not overwritten.
This requires enabling the “ext” cargo feature.
Trait Implementations§
source§impl Debug for ImportMapOptions
impl Debug for ImportMapOptions
source§impl Default for ImportMapOptions
impl Default for ImportMapOptions
source§fn default() -> ImportMapOptions
fn default() -> ImportMapOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ImportMapOptions
impl !Send for ImportMapOptions
impl !Sync for ImportMapOptions
impl Unpin for ImportMapOptions
impl !UnwindSafe for ImportMapOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more