diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-27 00:58:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 00:58:23 +0100 |
commit | 28b5a7e2ec519e6c1ff928d57368c0d8741a8bb4 (patch) | |
tree | 791f02bb6b41cfa250e56a07c64a1d75010de033 /cli/build.rs | |
parent | d4f659d1d3caa550dfc15ca9e62d4ad6a31db7ac (diff) |
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 <crowlkats@toaxl.com>
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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<PathBuf>) { 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( |