From 63d6a732c3c0e9c19fd4d147eaa5cc27c29b168d Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Tue, 17 Sep 2024 20:44:48 +0100 Subject: [PATCH] docs(package.json): add brief section on exports, link to Node.js docs (#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 --- docs/lib/content/configuring-npm/package-json.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/lib/content/configuring-npm/package-json.md b/docs/lib/content/configuring-npm/package-json.md index a7a0026ebcbbb..fe2a3bb619362 100644 --- a/docs/lib/content/configuring-npm/package-json.md +++ b/docs/lib/content/configuring-npm/package-json.md @@ -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