I’m not sure I understand well but it looks like if the use cases you created exists since you want to requirethe commonjs module as if they were actual ES6 modules.
The idea is to first load all CommonJS module, with a one object export shape and then load every ES6 modules.
As soon as you do not require CommonJS module, you would just use ES6 modules and if you require CommonJS modules then you would have to use the above quirks.
That said, monkey patching `System.import` could be monkey patched to wrap CommonJS modules instead of transpiling them a priori as i suggested before. It would give a chance to add all the constant added to modules by NodeJS like `__dirname`.
Sorry to bother you, i certainly not pretend to know the subject better than you but i want to be sure we won’t miss a simple way to go ESM.