diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-02-20 21:45:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-20 21:45:34 +0100 |
commit | 914b08fc19e5c7268e7b04a216337e765d6a06e8 (patch) | |
tree | 39f73f4e046346f358d74ff10f62cb2d5f7078a8 /cli/build.rs | |
parent | 4d1a14ca7fa9496f36470a7771448a9b006b0204 (diff) |
build: add "include_js_files_for_snapshotting" Cargo feature (#17826)
This allows to not include source code into the binary (because
it will already be included in the V8 snapshot).
Nothing changes for the embedders - everything should still build the
same.
This commit brings the binary size from 87Mb to 82Mb on M1.
Alternative to https://github.com/denoland/deno/pull/17820 and
https://github.com/denoland/deno/pull/17653
---------
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/build.rs b/cli/build.rs index 807009a5d..01127fded 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -360,8 +360,8 @@ fn create_cli_snapshot(snapshot_path: PathBuf) { ); esm_files.push(ExtensionFileSource { specifier: "runtime/js/99_main.js".to_string(), - code: ExtensionFileSourceCode::IncludedInBinary( - deno_runtime::js::SOURCE_CODE_FOR_99_MAIN_JS, + code: ExtensionFileSourceCode::LoadedFromFsDuringSnapshot( + std::path::PathBuf::from(deno_runtime::js::PATH_FOR_99_MAIN_JS), ), }); let extensions_with_js = vec![Extension::builder("cli") |