peterolson / BigInteger.js

An arbitrary length integer library for Javascript
The Unlicense
1.12k stars 187 forks source link

Missing export statement #225

Open nicolasr75 opened 2 years ago

nicolasr75 commented 2 years ago

I use BigInteger indirectly via redux in an ES6 based app that I build via rollup. Rollup fails to build because no default export of BigInteger can be found.

To fix this I added

export default bigInt;

at the end of BigInteger.js. Am I misunderstanding something here or is this really missing to make it work with ES6 imports?

peterolson commented 2 years ago

BigInteger.js uses CommonJS module.exports. Does your build system not support that?

nicolasr75 commented 2 years ago

Thanks for the quick reply. It looks like there is a rollup plugin that would enable using CommonJS exports. I just thought it would be nice to support ES6 directly, especially since it's only this one line to add. Now that ES6 modules are supported by all major browsers many people will start with ES6 directly and will stumble over this.