From eada4be95a3b3ac87d0b08e8c292700441e4ba9b Mon Sep 17 00:00:00 2001 From: Anurag Srivastava <144275260+anuragmerndev@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:05:57 +0530 Subject: [PATCH] feat: supporting esm import (#824) * feat: supporting esm import add the exports in package.json to support esm import for js and ts * feat: support for .js module export adding the support for .js module exports and support for types, nextjs, framework and recipe module exports --- package.json | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/package.json b/package.json index 2d99ff715..5d5c3df8d 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,52 @@ "type": "git", "url": "git+https://github.com/supertokens/supertokens-node.git" }, + "exports": { + ".": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "./framework/*": { + "types": "./framework/*/index.d.ts", + "default": "./framework/*/index.js" + }, + "./framework/*/index.js": { + "types": "./framework/*/index.d.ts", + "default": "./framework/*/index.js" + }, + "./nextjs": { + "types": "./nextjs/index.d.ts", + "default": "./nextjs/index.js" + }, + "./nextjs/index.js": { + "types": "./nextjs/index.d.ts", + "default": "./nextjs/index.js" + }, + "./types": { + "types": "./types/index.d.ts", + "default": "./types/index.js" + }, + "./types/index.js": { + "types": "./types/index.d.ts", + "default": "./types/index.js" + }, + "./lib/*": { + "types": "./lib/*/index.d.ts", + "default": "./lib/*/index.js" + }, + "./lib/*.js": { + "types": "./lib/*.d.ts", + "default": "./lib/*.js" + }, + "./recipe/*": { + "types": "./recipe/*/index.d.ts", + "default": "./recipe/*/index.js" + }, + "./recipe/*/index.js": { + "types": "./recipe/*/index.d.ts", + "default": "./recipe/*/index.js" + } + }, "author": "rishabhpoddar", "license": "Apache-2.0", "bugs": {