esm: treat modules with no extension as .js
with this change, extensionless modules loaded with esm loader will be loaded with the same behavior as .js files:
- if
"type": "module"
is specified, load as an esm module - 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), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines