ipld / js-dag-cbor

dag-cbor codec for IPLD
Other
27 stars 17 forks source link

use `esbuild` to create a `cjs` bundle #95

Closed mistermoe closed 1 year ago

mistermoe commented 1 year ago

Unfortunately, electron only supports cjs which is where we're trying to use this library.

This PR uses esbuild to create a cjs bundle. I noticed that y'all use aegir across many ipfs projects for bundling and testing. i suppose we could introduce an option there that builds cjs bundles when toggled on. That'll take some digging though

I've gone ahead and updated the exports object in package.json to include the cjs version of everything that's exported.

rvagg commented 1 year ago

Same comment as https://github.com/multiformats/js-multiformats/pull/250#issuecomment-1489933218, but the version you want here is ^7. The only major delta so far has been https://github.com/ipld/js-dag-cbor/pull/80 but it's rare for anyone to encounter that case so shouldn't be a concern.