mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
doc: stabilize packages features
These features are being used in production and are ready to be considered stable. Refs: https://github.com/nodejs/modules/issues/564 PR-URL: https://github.com/nodejs/node/pull/35742 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
b133034735
commit
a7da993cff
1 file changed
-16
@@ -252,8 +252,6 @@ absolute subpath of the package such as
|
||||
|
||||
### Subpath exports
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
When using the [`"exports"`][] field, custom subpaths can be defined along
|
||||
with the main entry point by treating the main entry point as the
|
||||
`"."` subpath:
|
||||
@@ -284,8 +282,6 @@ import submodule from 'es-module-package/private-module.js';
|
||||
|
||||
### Subpath imports
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
In addition to the [`"exports"`][] field, it is possible to define internal
|
||||
package import maps that only apply to import specifiers from within the package
|
||||
itself.
|
||||
@@ -369,8 +365,6 @@ targets, this expansion is dependent on only the files of the package itself.
|
||||
|
||||
### Exports sugar
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
If the `"."` export is the only export, the [`"exports"`][] field provides sugar
|
||||
for this case being the direct [`"exports"`][] field value.
|
||||
|
||||
@@ -395,8 +389,6 @@ can be written:
|
||||
|
||||
### Conditional exports
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
Conditional exports provide a way to map to different paths depending on
|
||||
certain conditions. They are supported for both CommonJS and ES module imports.
|
||||
|
||||
@@ -475,8 +467,6 @@ order to support packages with conditional exports. For this reason, using
|
||||
|
||||
### Nested conditions
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
In addition to direct mappings, Node.js also supports nested condition objects.
|
||||
|
||||
For example, to define a package that only has dual mode entry points for
|
||||
@@ -904,8 +894,6 @@ changes:
|
||||
description: Unflag `--experimental-modules`.
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
* Type: {string}
|
||||
|
||||
The `"type"` field defines the module format that Node.js uses for all
|
||||
@@ -972,8 +960,6 @@ changes:
|
||||
description: Implement conditional exports.
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
* Type: {Object} | {string} | {string[]}
|
||||
|
||||
```json
|
||||
@@ -1000,8 +986,6 @@ All paths defined in the `"exports"` must be relative file URLs starting with
|
||||
added: v14.6.0
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
* Type: {Object}
|
||||
|
||||
```json
|
||||
|
||||
Reference in new issue
Block a user