swc_bundler

Trait 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<T: ?Sized + Load> Load for &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§