pub trait SourceProvider: Send + Sync {
    fn read<'a>(&'a self, file: &Path) -> Result<&'a str>;
    fn resolve(
        &self,
        specifier: &str,
        originating_file: &Path
    ) -> Result<PathBuf, Error<BundleErrorKind<'_>>>; }
Expand description

A trait to provide the contents of files to a Bundler.

See FileProvider for an implementation that uses the file system.

Required Methods

Reads the contents of the given file path to a string.

Resolves the given import specifier to a file path given the file which the import originated from.

Implementors