module: implement "exports" proposal for CommonJS
Refs: https://github.com/jkrems/proposal-pkg-exports/issues/36 Refs: https://github.com/nodejs/node/pull/28568
Big open TODOs:
-
Unify errors between ESM and CommonJS. -
Implement directory matching. -
Figure out if we can reuse the more efficient package.json
read. -
Double-check that ESM and CommonJS share the same semantics. -
Update documentation for the CommonJS require algorithm.
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