@@ -953,7 +953,7 @@ See [the package examples repository][] for details.
953953added: REPLACEME
954954-->
955955
956- > Stability: 1 - Experimental
956+ > Stability: 1 - Experimental. Enable this API with [ ` --experimental-package-map ` ] [ ] .
957957
958958Package maps provide a mechanism to control package resolution without relying
959959on the ` node_modules ` folder structure. When enabled via the
@@ -969,15 +969,6 @@ This feature is useful for:
969969* ** Multiple versions** : Allow different packages to depend on different
970970 versions of the same dependency.
971971
972- ### Enabling package maps
973-
974- Package maps are enabled by passing the ` --experimental-package-map ` flag
975- with a path to the configuration file:
976-
977- ``` bash
978- node --experimental-package-map=./package-map.json app.js
979- ```
980-
981972### Configuration file format
982973
983974The package map configuration file is a JSON file with a ` packages ` object.
@@ -1107,7 +1098,7 @@ originates from:
11071098
11081099In the example above both ` lib-old ` and ` lib-new ` use the same ` ./lib ` folder to
11091100store their sources, the only difference being in which version of ` react ` they'll
1110- access when performing require calls.
1101+ access when performing ` require ` calls or using ` import ` .
11111102
11121103Because multiple package entries share the same path, resolving a bare specifier
11131104from a file within that path is ambiguous unless the originating package ID is
@@ -1120,21 +1111,6 @@ and propagate it from each resolution result to subsequent resolution requests.
11201111This ensures that when ` lib ` requires ` react ` , the runtime knows whether the
11211112request comes from ` lib-old ` or ` lib-new ` and can select the correct dependency.
11221113
1123- ### CommonJS and ES modules
1124-
1125- Package maps work with both CommonJS (` require() ` ) and ES modules (` import ` ).
1126- The resolution behavior is identical for both module systems.
1127-
1128- ``` cjs
1129- // CommonJS
1130- const utils = require (' @myorg/utils' );
1131- ```
1132-
1133- ``` mjs
1134- // ES modules
1135- import utils from ' @myorg/utils' ;
1136- ```
1137-
11381114### Interaction with other resolution
11391115
11401116Package maps only apply to bare specifiers that are not Node.js builtin
0 commit comments