summaryrefslogtreecommitdiff
path: root/cli/module_loader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/module_loader.rs')
-rw-r--r--cli/module_loader.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/module_loader.rs b/cli/module_loader.rs
index 37d42f78e..4a020516e 100644
--- a/cli/module_loader.rs
+++ b/cli/module_loader.rs
@@ -541,7 +541,8 @@ impl<TGraphContainer: ModuleGraphContainer>
self.parsed_source_cache.free(specifier);
Ok(Some(ModuleCodeStringSource {
- code: ModuleSourceCode::Bytes(transpile_result),
+ // note: it's faster to provide a string if we know it's a string
+ code: ModuleSourceCode::String(transpile_result.into()),
found_url: specifier.clone(),
media_type,
}))
@@ -571,7 +572,8 @@ impl<TGraphContainer: ModuleGraphContainer>
self.parsed_source_cache.free(specifier);
Ok(Some(ModuleCodeStringSource {
- code: ModuleSourceCode::Bytes(transpile_result),
+ // note: it's faster to provide a string if we know it's a string
+ code: ModuleSourceCode::String(transpile_result.into()),
found_url: specifier.clone(),
media_type,
}))