curvenote / prosemirror-docx

Export a prosemirror document to a Microsoft Word file, using docx.
MIT License
96 stars 13 forks source link

Add ESM bundling with Rollup #3

Closed TeemuKoivisto closed 1 year ago

TeemuKoivisto commented 2 years ago

Hey so as I said ESM is the way to go with Node.js modules nowadays and I finally got around copy-pasting my own Rollup bundling to this project. If there was some example setup I could have tested linking the built module locally but if you have some project that uses this, just yarn link in this repo and then yarn link prosemirror-docx in the other one and you should be able to test if the bundling works as it should.

I also added the --frozen-lockfile to the workflow. I've had problems with caching my yarn install properly but I'm not sure does this help. It's though more appropriate I think.

rowanc1 commented 2 years ago

This is fantastic -- apparently lost the notification, sorry for the delay in getting back to you.

I will take a look in the next few days and hopefully get it out. Not my area of expertise at all. :)

Appreciate the help!!

TeemuKoivisto commented 2 years ago

This is fantastic -- apparently lost the notification, sorry for the delay in getting back to you.

I will take a look in the next few days and hopefully get it out. Not my area of expertise at all. :)

Appreciate the help!!

No problem at all, this bundling is in general quite arcane business and it does improve life quality if you don't need to get deep into it 😅.

Rollup works well with simple setups, the biggest problems I've had with it were due to using obscure combinations of old libraries, Svelte and pnpm. The ordering of the plugins then become quite essential. I've heard esbuild is the fastest bundler (unless Rome has somehow beaten it) but they sacrifice conveniency to some extent.