-
Notifications
You must be signed in to change notification settings - Fork 675
Closed
Description
exports field is a new standard which adoption will inevitably grow further as the ecosystem switches to full ESM as NodeJS 10 reaches EOL. It's probably best to support it before things break. Features:
- Export submodules with sub-path exports;
- Specific exports for both CJS and ESM modules.
Example of subpath exports from NodeJS docs:
{
"type": "module",
"name": "es-module-package",
"main": "./main.js",
"exports": {
".": "./main.js",
"./submodule": "./src/submodule.js"
}
}The consumer of the library can now use:
import submodule from 'es-module-package/submodule';
// Loads ./node_modules/es-module-package/src/submodule.jsReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels