When you export primitives in ESM, they are exposed as references which means they can be written to from elsewhere within the module. A reproduction of this behaviour can be seen in #113.
Because the iitm wrappers assign each export to a variable before re-exporting, primitive exports have their original value copied and the reference is lost.
When you export primitives in ESM, they are exposed as references which means they can be written to from elsewhere within the module. A reproduction of this behaviour can be seen in #113.
Because the iitm wrappers assign each export to a variable before re-exporting, primitive exports have their original value copied and the reference is lost.
This is where the code generation does that: https://github.com/nodejs/import-in-the-middle/blob/57d2459748492abd55e04a679d8b5752b90dfab4/hook.js#L189-L190