This repo simply shows the fact that cjs-module-lexer
can produce unhelpful reexport results.
Specifically, the lexer resets the reexport set causing only the last instance of module.exports = require(...)
to be considered.
For example parsing the below code:
if (true) {
module.exports = require("./a.cjs");
} else {
module.exports = require("./b.cjs");
}
yields { exports: [], reexports: [ './b.cjs' ] }
, completely loosing the information that the module is also trying to re-export from './a.cjs'
npm i
npm start