summaryrefslogtreecommitdiff
path: root/cli/tools/compile.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-12-07 22:35:53 -0500
committerGitHub <noreply@github.com>2023-12-07 22:35:53 -0500
commitd192cc264020a8eeeafbdde4f06bb9b1cae9a5d2 (patch)
tree5fde52081f70beb2a9b565d456a8d2ba3c24c5e5 /cli/tools/compile.rs
parent3724d44d59950040f6ebbdd87d7eb93bc59c3caa (diff)
fix: add more warnings when using sloppy imports (#21503)
One warning for when using it with `deno compile` and another when using it with `deno run`.
Diffstat (limited to 'cli/tools/compile.rs')
-rw-r--r--cli/tools/compile.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs
index b36ee94bd..b8007f7fd 100644
--- a/cli/tools/compile.rs
+++ b/cli/tools/compile.rs
@@ -37,6 +37,18 @@ pub async fn compile(
vec
};
+ // this is not supported, so show a warning about it, but don't error in order
+ // to allow someone to still run `deno compile` when this is in a deno.json
+ if cli_options.unstable_sloppy_imports() {
+ log::warn!(
+ concat!(
+ "{} Sloppy imports are not supported in deno compile. ",
+ "The compiled executable may encouter runtime errors.",
+ ),
+ crate::colors::yellow("Warning"),
+ );
+ }
+
let output_path = resolve_compile_executable_output_path(
&compile_flags,
cli_options.initial_cwd(),