swc_ecma_transforms_module::path

Trait ImportResolver

source
pub trait ImportResolver {
    // Required method
    fn resolve_import(
        &self,
        base: &FileName,
        module_specifier: &str,
    ) -> Result<JsWord, Error>;
}

Required Methods§

source

fn resolve_import( &self, base: &FileName, module_specifier: &str, ) -> Result<JsWord, Error>

Resolves target as a string usable by the modules pass.

The returned string will be used as a module specifier.

Implementations on Foreign Types§

source§

impl<P> ImportResolver for &P
where P: ImportResolver,

source§

fn resolve_import(&self, base: &FileName, target: &str) -> Result<JsWord, Error>

source§

impl<P> ImportResolver for Box<P>
where P: ImportResolver,

source§

fn resolve_import(&self, base: &FileName, target: &str) -> Result<JsWord, Error>

source§

impl<P> ImportResolver for Arc<P>
where P: ImportResolver,

source§

fn resolve_import(&self, base: &FileName, target: &str) -> Result<JsWord, Error>

Implementors§