From 28b5a7e2ec519e6c1ff928d57368c0d8741a8bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 27 Nov 2022 00:58:23 +0100 Subject: feat(core): support initializing extensions with and without JS (#16789) This commit allows to execute more JS code from extensions when creating a snapshot from an existing snapshot. "deno_core::RuntimeOptions::extensions_with_js" field was added that is used to pass a list of extensions whose both "ops" and associated JS source should be executed upon start. Co-authored-by: crowlkats --- cli/build.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli/build.rs') diff --git a/cli/build.rs b/cli/build.rs index 15be033fd..4865cadb5 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -243,6 +243,7 @@ mod ts { Ok(()) }) .build()], + extensions_with_js: vec![], additional_files: files, compression_cb: Some(Box::new(|vec, snapshot_slice| { vec.extend_from_slice( @@ -304,6 +305,7 @@ fn create_cli_snapshot(snapshot_path: PathBuf, files: Vec) { snapshot_path, startup_snapshot: Some(deno_runtime::js::deno_isolate_init()), extensions, + extensions_with_js: vec![], additional_files: files, compression_cb: Some(Box::new(|vec, snapshot_slice| { lzzzz::lz4_hc::compress_to_vec( -- cgit v1.2.3