Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include conditional exports in package.json #31

Open
zhiyuanliang-ms opened this issue Aug 24, 2024 · 0 comments
Open

Include conditional exports in package.json #31

zhiyuanliang-ms opened this issue Aug 24, 2024 · 0 comments
Assignees

Comments

@zhiyuanliang-ms
Copy link
Contributor

zhiyuanliang-ms commented Aug 24, 2024

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.

@zhiyuanliang-ms zhiyuanliang-ms self-assigned this Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant