Leaflet: Need documentation for bundling ES6 Leaflet modules

Created on 27 Sep 2017  ·  3Comments  ·  Source: Leaflet/Leaflet

Since the transformation to ES6 it should be possible to import only the needed parts of Leaflet and not the whole library.

Is there any documentation, examples, or whatnot, available for this kind of usage?

It would be extremely great to have a simple guide on this which would list inter-dependencies, what you should note when importing just a piece, and so forth. Like "to have this and that functionality, import this" and "if you import that, also this is going to get imported since that depends on it".

Any thoughts?

docs help wanted

All 3 comments

👍

I think this would be incredibly usefull. Right now leaflet takes up about 1/3 of my bundle size. Since I only use a fraction of the functionality this could be reduced a lot by only importing the parts that I need

I was tempted to close this as a duplicate of https://github.com/Leaflet/Leaflet/issues/5696 , but then I noticed that this is actually a request for documentation on how to bundle ES6 Leaflet.

@IvanSanchez yes I read through that and thought this doesn't belong to the issue thread. Should have noted in my original msg :)

Was this page helpful?
0 / 5 - 0 ratings