Skip to content

Commit

Permalink
build commonjs and ESM (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisinger authored Jan 30, 2025
1 parent 8fc29b4 commit 9c72e6f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
"name": "@arklabs/wallet-sdk",
"version": "0.0.5",
"description": "Bitcoin wallet SDK with Taproot and Ark integration",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"main": "./dist/cjs/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
],
Expand All @@ -13,7 +21,7 @@
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "tsc",
"build": "rm -rf dist && tsc && tsc -p tsconfig.cjs.json",
"test": "vitest run",
"test:unit": "vitest run --exclude test/integration.test.ts",
"test:setup": "node test/setup.js",
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "./dist/cjs"
}
}
9 changes: 3 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"module": "esnext",
"moduleResolution": "node",
"declaration": true,
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true
},
"include": [
"src",
"test/integration.test.ts",
"test/wallet.test.ts",
"test/esplora.test.ts"
"src"
],
"exclude": [
"node_modules",
Expand Down

0 comments on commit 9c72e6f

Please sign in to comment.