mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
feat(compile): Enable multiple roots for a standalone module graph (#17663)
This change will enable dynamic imports and web workers to use modules not reachable from the main module, by passing a list of extra side module roots as options to `deno compile`. This can be done by specifying "--include" flag that accepts a file path or a URL. This flag can be specified multiple times, to include several modules. The modules specified with "--include" flag, will be added to the produced "eszip".
This commit is contained in:
parent
a80d1b6e66
commit
b64ec79268
8 changed files with 93 additions and 8 deletions
|
@ -150,7 +150,7 @@ pub fn graph_lock_or_exit(graph: &ModuleGraph, lockfile: &mut Lockfile) {
|
|||
}
|
||||
|
||||
pub async fn create_graph_and_maybe_check(
|
||||
root: ModuleSpecifier,
|
||||
roots: Vec<ModuleSpecifier>,
|
||||
ps: &ProcState,
|
||||
) -> Result<Arc<deno_graph::ModuleGraph>, AnyError> {
|
||||
let mut cache = cache::FetchCacher::new(
|
||||
|
@ -176,7 +176,7 @@ pub async fn create_graph_and_maybe_check(
|
|||
build_graph_with_npm_resolution(
|
||||
&mut graph,
|
||||
&ps.npm_resolver,
|
||||
vec![root],
|
||||
roots,
|
||||
&mut cache,
|
||||
deno_graph::BuildOptions {
|
||||
is_dynamic: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue