Skip to content

Commit

Permalink
feat: update package.json exports (#249)
Browse files Browse the repository at this point in the history
* fix: add fallback `./*` -> `./*.js` export

This allows us to `import` or `require` from any arbitrary entry point without breaking the overrides above it.

Currently, for instance, it is not possible to do `import { validateCartItems } from 'use-shopping-cart/utilities/serverless'`. This is fixed by this PR.

* chore: `./utilities/*` to JS source files, `./*` to dist TS output
  • Loading branch information
ctjlewis authored Nov 29, 2021
1 parent 6fd480c commit ee2fe53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion use-shopping-cart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"./utilities": {
"require": "./utilities/serverless.js",
"node": "./utilities/serverless.js"
}
},
"./utilities/*": "./utilities/*.js",
"./*": "./dist/*.js"
},
"engines": {
"node": ">=8",
Expand Down

0 comments on commit ee2fe53

Please sign in to comment.