You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Majority of the bundle is taken up by jsts (~430kb) which is a dependency of turf-intersect which we use for determining polygon intersections.
I don't think externalising turf-intersect makes much sense, as it's a fairly niche dependency. Requiring it to be an external dependency only defers the issue since the eventual bundle size remains the same.
When gzipped bundle size is ~127kb which of course you should be applying server-side. I actually think that's a fairly healthy size for the complexity of FreeDraw.
It may also be worth considering dynamically importing FreeDraw, and displaying a loading message of some kind whilst the chunk is loaded:
asyncloadMap(textNode){textNode.innerHTML='We are loading the map...';awaitimport('./map-with-freedraw.js');// voila...}
That way FreeDraw stays out of the your main bundle, and is only requested when actually needed.
Thanks @Wildhoney for answering me. I currently have gzip compression. I'll load the module async with dynamic import and I'll keep following the project.
Hi,
I like very much this library! I'm building the library with webpack and the result file weight ~600 kb. Is there a way to reduce the bundle size?
Thanks for your suggestions
The text was updated successfully, but these errors were encountered: