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

Support --exports option to generate package.json exports. #43

Open
knightedcodemonkey opened this issue May 29, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@knightedcodemonkey
Copy link
Owner

Add an --exports option that will generate package.json exports based on the build output.
It should not support any additional configuration but instead assume basic defaults (if it requires a configuration file, then I see little point in automating this).

The option should accept these values:

  • wildcard uses the first path segment from path.parse().dir run on each directory within the build output to build a wildcard subpath.
  • dir uses the last path segment from path.parse().dir run on each directory within the build output to build a wildcard subpath.
  • name uses the path.parse().name run on each file in the build output to build the subpath.

The option should use these defaults:

  • conditional exports of types, import, require and default will be included.
  • package.json main maps to the "." subpath where default is exactly the value in main, and all other default conditional exports in defined subpaths will use the module system implied by the file extension (or directory) used in the main value.
  • all subpaths will be extensionless.
@knightedcodemonkey knightedcodemonkey added the enhancement New feature or request label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant