Files
Andrew BradleyandGitHub 83a02e4a1e Implement ERR_REQUIRE_ESM when a file is require()d which should be loaded as ESM (#1031)
* revert addition of package.json "exports" because it is a breaking change and requires more thought

* Implement ERR_REQUIRE_ESM error when attempting to require() an ESM file

* fix

* test on node 12.15 and 12.16 due to weird ESM handling

* Switch package.json "type" feature detection to a simple version number check

* Remove dead code

* Only throw ERR_REQUIRE_ESM if experimental ESM loader is enabled, since it is a breaking change

* Fix linter failures

* Add tests

* fix test?

* Fix tests

* add comments to explain copy-pasted cjs loader code from node core

* fix

* tweak comment
2020-05-19 20:27:37 -04:00

4 lines
23 B
JSON