Include conditional exports in package.json

Open
#31 0 comments 0 reactions 1 assignee View on GitHub

@zhiyuanliang-ms is already working on this.

Since Aug 24, 2024.

Assessment

This issue has not been assessed yet.

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.

Dominant language
TypeScript
Stars
19
Forks
6
Avg merge
2d 3h
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/FeatureManagement-JavaScript

All issues in microsoft/FeatureManagement-JavaScript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.