From f80a1fa7e9f0a865a023be26cd76614faa030433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 13 Feb 2023 15:34:32 +0100 Subject: refactor(runtime): reorganize build script for snapshot (#17760) This commit reorganizes "runtime/build.rs" to properly create an extension and conditionally include "99_main.js" in the snapshot. --- cli/build.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cli') diff --git a/cli/build.rs b/cli/build.rs index d54e22be8..752b80635 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -351,8 +351,13 @@ fn create_cli_snapshot(snapshot_path: PathBuf) { specifier: "runtime/js/99_main.js".to_string(), code: deno_runtime::js::SOURCE_CODE_FOR_99_MAIN_JS, }); - let extensions_with_js = - vec![Extension::builder("cli").esm(esm_files).build()]; + let extensions_with_js = vec![Extension::builder("cli") + // FIXME(bartlomieju): information about which extensions were + // already snapshotted is not preserved in the snapshot. This should be + // fixed, so we can reliably depend on that information. + // .dependencies(vec!["runtime"]) + .esm(esm_files) + .build()]; create_snapshot(CreateSnapshotOptions { cargo_manifest_dir: env!("CARGO_MANIFEST_DIR"), -- cgit v1.2.3