When CJS is imported from ESM, only static properties are available for named imports. Properties defined using Object.defineProperty are only available through module.default.property. Would it make sense to create a loader that handles CJS imports differently? Is that at all possible? IIRC only ESM imports are handled by custom loaders.
When CJS is imported from ESM, only static properties are available for named imports. Properties defined using
Object.definePropertyare only available throughmodule.default.property. Would it make sense to create a loader that handles CJS imports differently? Is that at all possible? IIRC only ESM imports are handled by custom loaders.