Closed Scavanger closed 4 months ago
I would say in the year 2024, that is no longer common in our ES6+ world. For this plugin, just doing an import 'leaflet-arrowheads'
will attach all the arrowheads code to the global L
object already. Are you working in an ES5 codebase? If so, I'd recommend just grabbing the source code for this plugin from the repo and using it however it makes sense to you, or following the "Without ES6 Imports" section in the README.
Adding compatibility for something like this is not a high priority for me ATM. Closing as a "won't do."
For Leaflet plugins its common to define AMD, CommonJS and ESM exports. It just needs this wrapper around the Code: