From 617eeabe8369d7bfca7951d1cd55ac58ede1f9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 18 Oct 2021 19:36:28 +0200 Subject: feat(unstable): Node CJS and ESM resolvers for compat mode (#12424) This commit adds CJS and ESM Node resolvers to the "--compat" mode. The functionality is spread across "cli/compat" module and Node compatibility layer in "deno_std/node"; this stems from the fact that ES module resolution can only be implemented in Rust as it needs to directly integrated with "deno_core"; however "deno_std/node" already provided CJS module resolution. Currently this resolution is only active when running a files using "deno run --compat --unstable ", and is not available in other subcommands, which will be changed in follow up commits. --- cli/compat/testdata/basic/node_modules/foo/index.js | 0 cli/compat/testdata/basic/node_modules/foo/package.json | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 cli/compat/testdata/basic/node_modules/foo/index.js create mode 100644 cli/compat/testdata/basic/node_modules/foo/package.json (limited to 'cli/compat/testdata/basic/node_modules/foo') diff --git a/cli/compat/testdata/basic/node_modules/foo/index.js b/cli/compat/testdata/basic/node_modules/foo/index.js new file mode 100644 index 000000000..e69de29bb diff --git a/cli/compat/testdata/basic/node_modules/foo/package.json b/cli/compat/testdata/basic/node_modules/foo/package.json new file mode 100644 index 000000000..a74d52fd3 --- /dev/null +++ b/cli/compat/testdata/basic/node_modules/foo/package.json @@ -0,0 +1,5 @@ +{ + "name": "foo", + "type": "module", + "exports": "./index.js" +} -- cgit v1.2.3