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 <filename>", and is not available in other
subcommands, which will be changed in follow up commits.
This commit is contained in:
Bartek Iwańczuk 2021-10-18 19:36:28 +02:00 committed by GitHub
parent 5a48d41bdd
commit 617eeabe83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1606 additions and 139 deletions

1
cli/compat/testdata/basic/main.js vendored Normal file
View file

@ -0,0 +1 @@
import "foo";