From 04a46b815c76b002b4427ca37d3cf25c8b344d55 Mon Sep 17 00:00:00 2001 From: Moe Jangda Date: Sun, 19 Feb 2023 16:27:52 -0600 Subject: [PATCH] include the `exports` property in the root package.json to allow node environments to use cjs or esm bundles --- package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5d64756..0e9f475 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,11 @@ "url": "https://github.com/fiatjaf/nostr-tools.git" }, "main": "lib/nostr.cjs.js", - "module": "lib/nostr.esm.js", + "module": "lib/esm/nostr.mjs", + "exports": { + "import": "./lib/esm/nostr.mjs", + "require": "./lib/nostr.cjs.js" + }, "dependencies": { "@noble/hashes": "1.0.0", "@noble/secp256k1": "^1.7.1",