diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-02-27 14:38:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-27 14:38:45 +0100 |
commit | a65ce33fabb44bb2d9ed04773f7f334ed9c9a6b5 (patch) | |
tree | f5c169945377c3f806b514162408b81b5611ad44 /runtime/examples/hello_runtime.rs | |
parent | 4bea1d06c7ddb177ed20e0f32b70d7ff889871ab (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 'runtime/examples/hello_runtime.rs')
0 files changed, 0 insertions, 0 deletions