Skip to content

[FEATURE] auto add files from exports map #58

@privatenumber

Description

@privatenumber

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions