Trait swc_bundler::Load

source ·
pub trait Load: Send + Sync {
    // Required method
    fn load(&self, file: &FileName) -> Result<ModuleData, Error>;
}
Expand description

Responsible for providing files to the bundler.

Note: Resolve and Load are separate trait because multiple module can depend on a single module. Due to the possibility of ‘common’ module, bundler should implement some caching. The bundler uses [FileName] as a key of the cache.

This trait is designed to allow passing pre-parsed module.

Required Methods§

source

fn load(&self, file: &FileName) -> Result<ModuleData, Error>

Implementations on Foreign Types§

source§

impl<'a, T: ?Sized + Load> Load for &'a T

source§

fn load(&self, file: &FileName) -> Result<ModuleData, Error>

source§

impl<T: ?Sized + Load> Load for Box<T>

source§

fn load(&self, file: &FileName) -> Result<ModuleData, Error>

Implementors§