Yomguithereal / baobab

JavaScript & TypeScript persistent and optionally immutable data tree with cursors.
MIT License
3.15k stars 115 forks source link

Support ES Modules #503

Open anthony-redFox opened 6 years ago

anthony-redFox commented 6 years ago

It was broken in version 2.5.2.

bradrydzewski commented 5 years ago

apologies for what amounts to a +1 comment, but wondering if support for es modules could be added for the package. With major browsers supporting imports and tooling like pikapkg having an es module would be very useful :)

Yomguithereal commented 5 years ago

If you can find a non-breaking way to support this I would of course be willing to review a PR on the matter. Would this just amount to adding some config keys to package.json?

bradrydzewski commented 5 years ago

I have only ever done this with rollup, but you need to generate your distribution in iife format, and then in your package.json you include the path to this file in the module section.

"module": "build/module/index.js"

What are you currently using to build your distribution? I can try to integrate into your existing build process. Or if you are open to some additional tooling I can submit a rollup file and include a build command in the package.json to generate the iife module.