mirror of
https://github.com/denoland/deno.git
synced 2025-01-20 20:42:19 -05:00
9aa02769c8
This is achieved by storing CJS export analysis ahead of time in the executable, which should also improve the performance of `denort` by this never being done anymore (I'm too lazy atm to bench this, but it will be significant for some programs).
53 lines
1.2 KiB
Rust
53 lines
1.2 KiB
Rust
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
// Utilities shared between `build.rs` and the rest of the crate.
|
|
|
|
use deno_core::extension;
|
|
use deno_core::Extension;
|
|
|
|
extension!(runtime,
|
|
deps = [
|
|
deno_webidl,
|
|
deno_console,
|
|
deno_url,
|
|
deno_tls,
|
|
deno_web,
|
|
deno_fetch,
|
|
deno_cache,
|
|
deno_websocket,
|
|
deno_webstorage,
|
|
deno_crypto,
|
|
deno_broadcast_channel,
|
|
deno_node,
|
|
deno_ffi,
|
|
deno_net,
|
|
deno_napi,
|
|
deno_http,
|
|
deno_io,
|
|
deno_fs
|
|
],
|
|
esm_entry_point = "ext:runtime/90_deno_ns.js",
|
|
esm = [
|
|
dir "js",
|
|
"01_errors.js",
|
|
"01_version.ts",
|
|
"06_util.js",
|
|
"10_permissions.js",
|
|
"11_workers.js",
|
|
"40_fs_events.js",
|
|
"40_tty.js",
|
|
"41_prompt.js",
|
|
"90_deno_ns.js",
|
|
"98_global_scope_shared.js",
|
|
"98_global_scope_window.js",
|
|
"98_global_scope_worker.js"
|
|
],
|
|
customizer = |ext: &mut Extension| {
|
|
#[cfg(not(feature = "exclude_runtime_main_js"))]
|
|
{
|
|
use deno_core::ascii_str_include;
|
|
use deno_core::ExtensionFileSource;
|
|
ext.esm_files.to_mut().push(ExtensionFileSource::new("ext:runtime_main/js/99_main.js", ascii_str_include!("./js/99_main.js")));
|
|
ext.esm_entry_point = Some("ext:runtime_main/js/99_main.js");
|
|
}
|
|
}
|
|
);
|