utxostack / rgbpp-sdk

Utilities for Bitcoin and RGB++ asset integration
ISC License
53 stars 19 forks source link

Export an ESM (ECMAScript Module) package for rgbpp-sdk #245

Closed duanyytop closed 3 months ago

duanyytop commented 5 months ago

Now the rgbpp-sdk only exports CommonJS package, and it will cause a Named Exports issue when developers use ESM to import rgbpp-sdk like this:

"Named export 'Types' not found. The requested module 'mongoose' is a CommonJS module, which may not support all module.exports as named exports"

reference: https://stackoverflow.com/questions/70605320/named-export-types-not-found-the-requested-module-mongoose-is-a-commonjs-mo

To avoid potential issues, it is recommended to export an ESM package for rgbpp-sdk.