summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-03-11 02:33:02 +0100
committerGitHub <noreply@github.com>2022-03-11 02:33:02 +0100
commit808f797633ba82c0e9198481ddd742284a03cb9c (patch)
treeda54caf98d23d05d855f367c48821b1ece9517b3 /cli/main.rs
parent8db3a9546b59fdd5e7203f2e63a828e3c5108e7e (diff)
fix(compat): cjs/esm interop for dynamic imports (#13792)
This commit fixes CJS/ESM interop in compat mode for dynamically imported modules. "ProcState::prepare_module_load" was changed to accept a list of "graph roots" without associated "module kind". That module kind was always hardcoded to "ESM" which is not true for CJS/ESM interop - a CommonJs module might be imported using "import()" function. In such case the root of the graph should have "CommonJs" module kind instead of "ESM".
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 3e49380d9..bb2a0afb3 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -586,7 +586,7 @@ async fn cache_command(
for file in cache_flags.files {
let specifier = resolve_url_or_path(&file)?;
ps.prepare_module_load(
- vec![(specifier, deno_graph::ModuleKind::Esm)],
+ vec![specifier],
false,
lib.clone(),
Permissions::allow_all(),