(3) The property value is ignored and property key is used as target. (2) "./" is intentionally ignored as key. (1) deprecated in Node.js, * should be preferred. Node.js, webpack, rollup, esinstall, wmr (7) Node.js (1), webpack, rollup, esinstall (2), wmr (3) a/)Įxports field is preferred over other package entry fields like main, module, browser or custom ones. Properties ending with a / will forward a request with this prefix to the old file system lookup algorithm.įor properties ending with *, * may take any value and any * in the property value is replaced with the taken value.Īn example: (order will always be. "." for import "package" and "./sub/path" for import "package/sub/path". Where each properties specifies a sub path of the module request.įor the examples above the following properties could be used: In general the exports field should contain an object When the exports field is specified, only these module requests are available.Īny other requests will lead to a ModuleNotFound Error. The file system lookup for "package/sub/path". It replaces the default implementation that returns main field resp. Which module should be used when using module requests like import "package" or import "package/sub/path". The exports field in the package.json of a package allows to declare
0 Comments
Leave a Reply. |