From 91b2e770e68dd36e0e56d80f69cfb821d4e1c7a9 Mon Sep 17 00:00:00 2001 From: tjs Date: Thu, 30 Jun 2022 13:17:10 -0400 Subject: [PATCH] add esm tsconfig --- package.json | 5 +++-- tsconfig.esm.json | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 tsconfig.esm.json diff --git a/package.json b/package.json index fe234cce5..bfbb58713 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,16 @@ "url": "https://blockworks.foundation" }, "main": "dist/cjs/src/index.js", + "module": "dist/esm/src/index.js", "types": "dist/types/src/index.d.ts", "sideEffects": false, "files": [ "dist" ], "scripts": { - "build": "npm run build:cjs", + "build": "npm run build:esm; npm run build:cjs", "build:cjs": "tsc -p tsconfig.cjs.json", + "build:esm": "tsc -p tsconfig.esm.json", "clean": "rm -rf dist", "example1-user": "ts-node ts/client/src/scripts/example1-user.ts", "example1-admin": "ts-node ts/client/src/scripts/example1-admin.ts", @@ -24,7 +26,6 @@ "format": "prettier --check .", "lint": "eslint . --ext ts --ext tsx --ext js --quiet", "typecheck": "tsc --noEmit --pretty", - "prepare": "yarn build", "prebuild": "npm run clean", "prepublishOnly": "npm run validate && npm run build", "validate": "npm run typecheck && npm run test && npm run lint && npm run format-check" diff --git a/tsconfig.esm.json b/tsconfig.esm.json new file mode 100644 index 000000000..a7da90121 --- /dev/null +++ b/tsconfig.esm.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.build", + "compilerOptions": { + "declaration": true, + "declarationDir": "dist/types", + "module": "esnext", + "outDir": "dist/esm" + } +}