Esri / esri-leaflet

A lightweight set of tools for working with ArcGIS services in Leaflet. :rocket:
https://developers.arcgis.com/esri-leaflet/
Apache License 2.0
1.6k stars 798 forks source link

Release ESM build in dist #1338

Open gavinr opened 2 years ago

gavinr commented 2 years ago

Describe the problem

An ESM file is not included in the Esri Leaflet release: https://unpkg.com/browse/esri-leaflet@3.0.8/dist/ ... but would it be good if we did? I think this would allow users to import ESM directly from CDNs like Unpkg.

Describe the proposed solution

Leaflet releases an ESM build in their dist release. They started doing it at v1.3.2:

I have not looked into how they are generating it but I assume we could do a similar thing.

Alternatives considered

A workaround is to use the Skypack CDN like this: https://codepen.io/pen?template=wvoKwEv , but adding the ESM file ourselves would give added flexibility.

Additional Information

No response

patrickarlt commented 2 years ago

This sounds good to me.

jgravois commented 2 years ago

at this point i don't even remember how far i got with it, but you can find some prior art here 🎨

https://github.com/Esri/esri-leaflet/tree/es / https://github.com/Esri/esri-leaflet/commit/9d90ea594fbcc09b51b66500a780992c9a0e7d46