diff --git a/src/graph.rs b/src/graph.rs index ad262ad02..d9e18375a 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -3598,17 +3598,18 @@ impl<'a, 'graph> Builder<'a, 'graph> { specifier, maybe_headers: _maybe_headers, } if specifier == item.specifier => { - self.loader.cache_module_info( - &specifier, - &content, - &item.module_info, - ); // fill the existing module slot with the loaded source let slot = self.graph.module_slots.get_mut(&specifier).unwrap(); match slot { ModuleSlot::Module(module) => { match module { Module::Js(module) => { + self.loader.cache_module_info( + &specifier, + module.media_type, + &content, + &item.module_info, + ); match new_source_with_text( &module.specifier, content, diff --git a/src/source/mod.rs b/src/source/mod.rs index 7a53fe65e..8c8c1b87e 100644 --- a/src/source/mod.rs +++ b/src/source/mod.rs @@ -295,6 +295,7 @@ pub trait Loader { fn cache_module_info( &self, _specifier: &ModuleSpecifier, + _media_type: MediaType, _source: &Arc<[u8]>, _module_info: &ModuleInfo, ) {