summaryrefslogtreecommitdiff
path: root/Cargo.lock
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-02-27 14:38:45 +0100
committerGitHub <noreply@github.com>2022-02-27 14:38:45 +0100
commita65ce33fabb44bb2d9ed04773f7f334ed9c9a6b5 (patch)
treef5c169945377c3f806b514162408b81b5611ad44 /Cargo.lock
parent4bea1d06c7ddb177ed20e0f32b70d7ff889871ab (diff)
feat(compat): CJS/ESM interoperability (#13553)
This commit adds CJS/ESM interoperability when running in --compat mode. Before executing files, they are analyzed and all CommonJS modules are transformed on the fly to a ES modules. This is done by utilizing analyze_cjs() functionality from deno_ast. After discovering exports and reexports, an ES module is rendered and saved in memory for later use. There's a caveat that all files ending with ".js" extension are considered as CommonJS modules (unless there's a related "package.json" with "type": "module").
Diffstat (limited to 'Cargo.lock')
-rw-r--r--Cargo.lock12
1 files changed, 12 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f7a7e8cf6..c160cf8d5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -772,6 +772,7 @@ dependencies = [
"log",
"lspower",
"nix",
+ "node_resolver",
"notify",
"once_cell",
"os_pipe",
@@ -2467,6 +2468,17 @@ dependencies = [
]
[[package]]
+name = "node_resolver"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e35ed1604f6f4e33b51926d6be3bc09423f35eec776165c460c313dc2970ea5a"
+dependencies = [
+ "anyhow",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
name = "notify"
version = "5.0.0-pre.12"
source = "registry+https://github.com/rust-lang/crates.io-index"