Skip to content

Commit e239dcc

Browse files
committed
feat(wasm-utxo): add exports field to package.json
Add modern exports field with conditional exports for Node.js and browser environments. This provides better control over the package's public API and prevents deep imports into internal paths. Exports include: - Main entry point (.) - Submodules: address, ast, fixedScriptWallet, utxolibCompat Each export properly specifies types, browser, and default (Node) paths. Maintains full backward compatibility with existing imports.
1 parent de44db9 commit e239dcc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/wasm-utxo/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,33 @@
2323
],
2424
"main": "dist/node/js/index.js",
2525
"types": "dist/node/js/index.d.ts",
26+
"exports": {
27+
".": {
28+
"types": "./dist/node/js/index.d.ts",
29+
"browser": "./dist/browser/js/index.js",
30+
"default": "./dist/node/js/index.js"
31+
},
32+
"./address": {
33+
"types": "./dist/node/js/address.d.ts",
34+
"browser": "./dist/browser/js/address.js",
35+
"default": "./dist/node/js/address.js"
36+
},
37+
"./ast": {
38+
"types": "./dist/node/js/ast/index.d.ts",
39+
"browser": "./dist/browser/js/ast/index.js",
40+
"default": "./dist/node/js/ast/index.js"
41+
},
42+
"./fixedScriptWallet": {
43+
"types": "./dist/node/js/fixedScriptWallet.d.ts",
44+
"browser": "./dist/browser/js/fixedScriptWallet.js",
45+
"default": "./dist/node/js/fixedScriptWallet.js"
46+
},
47+
"./utxolibCompat": {
48+
"types": "./dist/node/js/utxolibCompat.d.ts",
49+
"browser": "./dist/browser/js/utxolibCompat.js",
50+
"default": "./dist/node/js/utxolibCompat.js"
51+
}
52+
},
2653
"sideEffects": [
2754
"./dist/node/js/wasm/wasm_utxo.js",
2855
"./dist/browser/js/wasm/wasm_utxo.js"

0 commit comments

Comments
 (0)