From 3e7095986286d68cec8d5cd53a09b45ee0ede4d5 Mon Sep 17 00:00:00 2001 From: Hari Date: Wed, 23 Jul 2025 18:28:51 +0800 Subject: [PATCH] update `package.json` for proper ESM and CJS module support --- package.json | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cc58ccb..e3732fd 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,22 @@ { "name": "@virtuals-protocol/acp-node", "version": "0.1.0-beta.15", - "main": "./dist/index.js", - "module": "./dist/index.mjs", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "tsup": "tsup src/index.ts --dts --format cjs,esm --out-dir dist" @@ -12,7 +25,8 @@ "license": "ISC", "description": "", "devDependencies": { - "typescript": "^5.8.3" + "typescript": "^5.8.3", + "tsup": "^8.5.0" }, "dependencies": { "@aa-sdk/core": "^4.30.0", @@ -20,7 +34,6 @@ "@account-kit/smart-contracts": "^4.30.0", "ajv": "^8.17.1", "socket.io-client": "^4.8.1", - "tsup": "^8.5.0", "viem": "^2.28.2" }, "files": [