mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
a65ce33fab
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"). |
||
---|---|---|
.. | ||
import_cjs_from_esm | ||
import_esm_from_cjs | ||
test_runner | ||
worker | ||
dyn_import_reject.js | ||
dyn_import_reject.out | ||
fs_promises.mjs | ||
fs_promises.out | ||
globals.out | ||
globals.ts | ||
import_cjs_from_esm.out | ||
import_map.json | ||
import_map_https_imports.mjs | ||
import_map_https_imports.out | ||
node_fs_promises.mjs | ||
test.txt |