diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-09-07 15:33:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 15:33:51 +0200 |
commit | 4a250b2f25d3e9fea31a1effb10d3fe07c3564ae (patch) | |
tree | c15442571cf271af1014df061f1aa7f1984e0e89 /cli/tools | |
parent | 3b1204eb2d9c5cdf21bb92f7c8923869477f0969 (diff) |
feat: add --no-npm flag to disable npm: imports (#15673)
This commit adds "--no-npm" flag, it's similar to "--no-remote"
flag. This flag makes Deno error out if "npm:" specifier is encountered.
Diffstat (limited to 'cli/tools')
-rw-r--r-- | cli/tools/installer.rs | 4 | ||||
-rw-r--r-- | cli/tools/standalone.rs | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 6928624ea..d1754562a 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -321,6 +321,10 @@ fn resolve_shim_data( executable_args.push("--no-remote".to_string()); } + if flags.no_npm { + executable_args.push("--no-npm".to_string()); + } + if flags.lock_write { executable_args.push("--lock-write".to_string()); } diff --git a/cli/tools/standalone.rs b/cli/tools/standalone.rs index 6046654b9..3a2bed105 100644 --- a/cli/tools/standalone.rs +++ b/cli/tools/standalone.rs @@ -279,6 +279,7 @@ pub fn compile_to_runtime_flags( .unsafely_ignore_certificate_errors .clone(), no_remote: false, + no_npm: false, no_prompt: flags.no_prompt, reload: false, seed: flags.seed, |