Skip to content

Commit

Permalink
docs(package.json): add brief section on exports, link to Node.js docs (
Browse files Browse the repository at this point in the history
#7783)

The package.json docs make no reference to the `exports` property, which
seems like a huge omission

This PR copies a little text from the node.js docs and links to them -
not sure if it's a good solution, but it's a start
  • Loading branch information
wheresrhys authored Sep 17, 2024
1 parent 366c07e commit 63d6a73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/lib/content/configuring-npm/package-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ the `files` globs. Exceptions to this are:

These can not be included.

### exports

The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. For more details see the [node.js documentation on package entry points](https://nodejs.org/api/packages.html#package-entry-points)

### main

The main field is a module ID that is the primary entry point to your
Expand Down

0 comments on commit 63d6a73

Please sign in to comment.