add esm tsconfig

This commit is contained in:
tjs 2022-06-30 13:17:10 -04:00
parent f8da1f6a40
commit 91b2e770e6
2 changed files with 12 additions and 2 deletions

View File

@ -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"

9
tsconfig.esm.json Normal file
View File

@ -0,0 +1,9 @@
{
"extends": "./tsconfig.build",
"compilerOptions": {
"declaration": true,
"declarationDir": "dist/types",
"module": "esnext",
"outDir": "dist/esm"
}
}