From ee2fe53222019d863aa9aa60396e84ef5abf3e9c Mon Sep 17 00:00:00 2001 From: "C. Lewis" <1657236+ctjlewis@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:24:53 -0600 Subject: [PATCH] feat: update package.json exports (#249) * 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 --- use-shopping-cart/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/use-shopping-cart/package.json b/use-shopping-cart/package.json index c68f0c2f..af22413e 100644 --- a/use-shopping-cart/package.json +++ b/use-shopping-cart/package.json @@ -27,7 +27,9 @@ "./utilities": { "require": "./utilities/serverless.js", "node": "./utilities/serverless.js" - } + }, + "./utilities/*": "./utilities/*.js", + "./*": "./dist/*.js" }, "engines": { "node": ">=8",