diff options
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cli/build.rs b/cli/build.rs index 74e35a632..ce4027d77 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -14,15 +14,29 @@ fn main() { let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); let o = PathBuf::from(env::var_os("OUT_DIR").unwrap()); + let custom_libs = vec![( + "lib.deno_runtime.d.ts".to_string(), + c.join("js/lib.deno_runtime.d.ts"), + )]; + let root_names = vec![c.join("js/main.ts")]; let bundle = o.join("CLI_SNAPSHOT.js"); - let state = deno_typescript::compile_bundle(&bundle, root_names).unwrap(); + let state = + deno_typescript::compile_bundle(&bundle, root_names, Some(custom_libs)) + .unwrap(); assert!(bundle.exists()); deno_typescript::mksnapshot_bundle(&bundle, state).unwrap(); + let custom_libs = vec![( + "lib.deno_runtime.d.ts".to_string(), + c.join("js/lib.deno_runtime.d.ts"), + )]; + let root_names = vec![c.join("js/compiler.ts")]; let bundle = o.join("COMPILER_SNAPSHOT.js"); - let state = deno_typescript::compile_bundle(&bundle, root_names).unwrap(); + let state = + deno_typescript::compile_bundle(&bundle, root_names, Some(custom_libs)) + .unwrap(); assert!(bundle.exists()); deno_typescript::mksnapshot_bundle_ts(&bundle, state).unwrap(); } |