mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
Reland "Create an old program to be used in snapshot." (#3747)
* read CLI assets from disk during snapshotting
This commit is contained in:
parent
3c47718959
commit
bd9561f4de
15 changed files with 126 additions and 64 deletions
10
cli/js.rs
10
cli/js.rs
|
@ -16,15 +16,7 @@ pub static COMPILER_SNAPSHOT_MAP: &[u8] =
|
|||
pub static COMPILER_SNAPSHOT_DTS: &[u8] =
|
||||
include_bytes!(concat!(env!("OUT_DIR"), "/COMPILER_SNAPSHOT.d.ts"));
|
||||
|
||||
static DENO_RUNTIME: &str = include_str!("js/lib.deno_runtime.d.ts");
|
||||
|
||||
/// Same as deno_typescript::get_asset but also has lib.deno_runtime.d.ts
|
||||
pub fn get_asset(name: &str) -> Option<&'static str> {
|
||||
match name {
|
||||
"lib.deno_runtime.d.ts" => Some(DENO_RUNTIME),
|
||||
_ => deno_typescript::get_asset(name),
|
||||
}
|
||||
}
|
||||
pub static DENO_RUNTIME: &str = include_str!("js/lib.deno_runtime.d.ts");
|
||||
|
||||
#[test]
|
||||
fn cli_snapshot() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue