add support for bundling both esm and cjs versions

This commit is contained in:
2024-10-25 12:09:56 -05:00
parent afebfe75b1
commit 7a5b027c68
5 changed files with 45 additions and 10 deletions
+14 -3
View File
@@ -2,11 +2,22 @@
"name": "@jwetzell/posistagenet",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
}
},
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"build": "npm run build:cjs && npm run build:esm && npm run build:types",
"build:cjs":"tsc -p tsconfig.cjs.json",
"build:esm":"tsc -p tsconfig.esm.json",
"build:types":"tsc -p tsconfig.types.json",
"example:client": "node examples/psn_client.js",
"example:server": "node examples/psn_server.js",
"prepublishOnly": "npm run build"