utxostack / rgbpp-sdk

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

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

Closed duanyytop closed 1 month ago

duanyytop commented 2 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.