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

[FEATURE] auto add files from exports map #58

Open
privatenumber opened this issue Mar 3, 2021 · 1 comment
Open

[FEATURE] auto add files from exports map #58

privatenumber opened this issue Mar 3, 2021 · 1 comment

Comments

@privatenumber
Copy link

What / Why

Node.js added a new exports property to package.json in v12.7.0 to define entry-points.

Since these files are definitely needed in the package, I'd like for files in the exports map be automatically added as well.

When

Whenever I define entry assets in the exports map for published packages.

Where

Any npm package

How

Current Behavior

Currently, npm-packlist automatically detects important files via package.json properties browser, main, and bin.

Expected Behavior

For files in the exports property to be automatically added too.

I'm not sure if the exports map is only respected by Node if "type": "module" is set, but if it is, it should conditionally only add the exports map given "type": "module".

This might be a dangerous change in case the exports property is used by some packages for something else, but checking the type will alleviate the risk a little bit. Might be worth a breaking change.

Who

  • n/a

References

  • n/a
@jaydenseric
Copy link

At the very least, it would be nice somewhere within the npm CLI for pack and publish commands to emit a warning or throw an error if the package exports field contains files that aren't published.

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

2 participants