Can I use Leaflet as an es6 module? Plugins too?

Viewed 467

Looking at the Leaflet docs, I don't see how to import Leaflet as an es6 module. And more importantly, all the Leaflet plugins as well.

Skypack converts Leaflet to modules:

import * as leaflet from 'https://cdn.skypack.dev/leaflet'

But I'm not sure how safe this approach would be. I'd prefer unpkg, but this:

https://unpkg.com/leaflet@1.7.1?module

.. produces:

Package leaflet@1.7.1 does not contain an ES module

So basically will using Leaflet in a "modern" repo run into problems with modules?

0 Answers
Related