Skip to content

esm: treat modules with no extension as .js

Rodrigo Muino Tomonari requested to merge github/fork/srolel/master into main

with this change, extensionless modules loaded with esm loader will be loaded with the same behavior as .js files:

  1. if "type": "module" is specified, load as an esm module
  2. otherwise, load as cjs module

Fixes: https://github.com/nodejs/node/issues/34049 Fixes: https://github.com/nodejs/node/issues/33226

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading