diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-05-19 18:39:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-19 22:39:27 +0000 |
commit | cc406c8360b4ba559d7f13e14d2a32e1ab761b0d (patch) | |
tree | a2cfae5c7f082261aa504b2f00fe6f53f4626dfe /cli/args/mod.rs | |
parent | 7f5290b6946fececec5ec3acd85e67cd16960b8e (diff) |
feat(vendor): support for npm specifiers (#19186)
We never properly added support for this. This fixes vendoring when it
has npm or node specifiers. Vendoring occurs by adding a
`"nodeModulesDir": true` property to deno.json then it uses a local
node_modules directory. This can be opted out by setting
`"nodeModulesDir": false` or running with `--node-modules-dir=false`.
Closes #18090
Closes #17210
Closes #17619
Closes #16778
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index fef27f464..fdef50983 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -881,6 +881,15 @@ impl CliOptions { self.maybe_node_modules_folder.clone() } + pub fn node_modules_dir_enablement(&self) -> Option<bool> { + self.flags.node_modules_dir.or_else(|| { + self + .maybe_config_file + .as_ref() + .and_then(|c| c.node_modules_dir()) + }) + } + pub fn node_modules_dir_specifier(&self) -> Option<ModuleSpecifier> { self .maybe_node_modules_folder |