Open
Description
Currently, we have main
and module
in the package.json which specify the entry point for cjs and esm. ref
exports
is supported by Node.js 12+ ref
Note that exports
will take precedence over the main
field: https://nodejs.org/api/packages.html#main
The exports
field can produce extra extensibility, for example, tools like webpack will know some specific fields. ref
BTW, this is how azure sdk does: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-auth/package.json
I prefer to follow azure sdk.
Metadata
Metadata
Assignees
Labels
No labels