Closed
Description
As discussed in today's meeting, we need to come up with a name for the flag that will allow require(esm) to support a custom value for a CJS module.
The pattern is that users can write:
export const __cjsModule = true;
export default module.exports;
where module.exports
can be any type of object, which will be returned by require(esm)
when it sees this __cjsModule
flag, instead of returning the full namespace.
@joyeecheung suggested a good name might be one that describes what it does, eg cjsUnwrapDefault
.
It should be unique enough that it will not collide with an existing export name for any ES module in use today.
Opening this thread for further discussion and suggestions, although I'm happy to go with something like @joyeecheung's option here above as well.
Metadata
Metadata
Assignees
Labels
No labels