Using Rollup for Turf
See original GitHub issueI am pretty sure everyone would agree on this one, reading back from a few comments from Turf users:
You may not need to remove JSTS now. Why? Because it seems the project is full ES6 compatible and you can use rollup.js to minimized the build size for buffer in particular. You also do not use all JSTS buffer possibilities e.g http://bl.ocks.org/ThomasG77/31037a8897b4980a0818 (illustrated with OpenLayers 3)
@ThomasG77 oh, nice to see that it switched to ES6 modules! We should consider using rollup.js short term. The main reason to switch is performance though, not bundle size, so we’re still pursuing our own implementation of polygon boolean operations.
It’s pretty straightforward converting a library to support Rollup, all we really need to do is add export & import
, the rest of the ES5 code stays the same.
Rollup Examples
- Leaflet https://github.com/Leaflet/Leaflet
- Global Mercator (simple rollup config) https://github.com/DenisCarriere/global-mercator
I don’t exactly know how we will be tackling this, but I’m willing to help out once we have a plan of attack.
We should set up a new branch rollup
for this type of work.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
We can revisit this topic whenever NodeJS supports
import/export
.Continuing discussion here: https://github.com/Turfjs/turf/issues/583