dimfeld / svelte-maplibre

Svelte bindings for the MapLibre mapping library
https://svelte-maplibre.vercel.app
MIT License
341 stars 40 forks source link

Tree shaking #209

Open chanmathew opened 1 week ago

chanmathew commented 1 week ago

Hi @dimfeld - I was reviewing my app for some potential optimizations and noticed that a lot of the components exported by Svelte Maplibre are importing the entire maplibre-gl lib, is it possible to tree shake them or is that blocked by this issue here? https://github.com/maplibre/maplibre-gl-js/issues/977

Please see below for bundle analysis: CleanShot 2024-11-06 at 16 10 17@2x

dimfeld commented 6 days ago

Yeah, as far as I know that issue you mentioned is the blocker and there's nothing we can do here to make tree shaking work. If you do discover some way in the future please let me know; I would like to take advantage of treeshaking if it becomes possible.