diff options
Diffstat (limited to 'runtime/build.rs')
-rw-r--r-- | runtime/build.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/build.rs b/runtime/build.rs index 016ece810..ec7c9642c 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -17,11 +17,12 @@ mod startup_snapshot { use deno_core::snapshot_util::*; use deno_core::Extension; use deno_core::ExtensionFileSource; + use deno_core::ModuleCode; use std::path::Path; fn transpile_ts_for_snapshotting( file_source: &ExtensionFileSource, - ) -> Result<String, AnyError> { + ) -> Result<ModuleCode, AnyError> { let media_type = MediaType::from_path(Path::new(&file_source.specifier)); let should_transpile = match media_type { @@ -41,7 +42,7 @@ mod startup_snapshot { let parsed = deno_ast::parse_module(ParseParams { specifier: file_source.specifier.to_string(), - text_info: SourceTextInfo::from_string(code), + text_info: SourceTextInfo::from_string(code.take_as_string()), media_type, capture_tokens: false, scope_analysis: false, @@ -53,7 +54,7 @@ mod startup_snapshot { ..Default::default() })?; - Ok(transpiled_source.text) + Ok(transpiled_source.text.into()) } #[derive(Clone)] |