kiln / flourish-sdk

The SDK for developing Flourish templates
Other
80 stars 16 forks source link

Replaces Rollup with ESBuild in the skeleton boilerplate #73

Open aendra-rininsland opened 2 years ago

aendra-rininsland commented 2 years ago

Fixes #72.

hughsk-canva commented 1 year ago

Ah wait, having tested this on a few templates it looks like esbuild's output isn't as small as rollup's — on one of our larger templates we had 976kB with esbuild, and 868kB with rollup + terser.

Because of the size difference we're going to continue to use rollup internally for at least some of our templates. I'm a bit more on the fence between the two tools with that in mind, but still really like that esbuild works so well out of the box for most modern projects. If not esbuild, then an update of the rollup boilerplate is definitely still in order!

Though it's not reflected in the SDK boilerplate, we currently use rollup --watch in combination with build.src.watch in template.yml for incremental builds, and disable babel/terser in development. With that we get ~2s for an incremental build on our largest template, which would otherwise be 32s if it were using the boilerplate. Not as fast as esbuild for sure, but still manageable :')

Unfortunately I'm about to go on break for a few weeks and won't be able to get an update through in time, but will think it through and let you know!