Skip to content

Commit

Permalink
change/API! ~ add package 'exports' to publicize ESM support
Browse files Browse the repository at this point in the history
- reveals ESM wrapper providing ESM support (as suggested in "Node Modules at War")

* ref: [Node Modules at War](https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1) @@ <https://archive.is/zl0qg>
* ref: [yargs ~ 'Road to ESM/Deno'](yargs/yargs#1706).
  • Loading branch information
rivy committed Feb 16, 2021
1 parent e4bfa58 commit aaa478c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions package.json
Expand Up @@ -17,8 +17,23 @@
"LICENSE",
"README.md"
],
"main": "src/lib/index.js",
"types": "src/lib/index.d.ts",
"type": "commonjs",
"main": "./dist/cjs/mod.cjs.js",
"module": "./dist/cjs/esm-wrapper/mod.esm.js",
"types": "./dist/types/mod.d.ts",
"exports": {
".": {
"import": "./dist/cjs/esm-wrapper/mod.esm.js",
"require": "./dist/cjs/mod.cjs.js",
"types": "./dist/types/mod.d.ts",
"default": "./dist/cjs/mod.cjs.js"
},
"./package.json": "./package.json",
"./cjs": {
"require": "./dist/cjs/mod.cjs.js",
"types": "./dist/cjs/mod.cjs.d.ts"
}
},
"keywords": [
"appdir",
"application",
Expand Down

0 comments on commit aaa478c

Please sign in to comment.