I have a client script that utilized the leaflet library like so:
define(['./modules/leaflet/leaflet','N/search', 'N/runtime'],
function(L, search, runtime) {
This works fine and I can use things like L.layerGroup(). The problem I have run into is there are several libraries people have made for leaflet. They all say to just load the js file after the leaflet one.
So if I add say the MarkerCluster library like so:
define(['./modules/leaflet/leaflet','N/search', 'N/runtime', './modules/MarkerCluster/leaflet.markercluster'],
I get an error that inside the markercluster library L is not defined.
Any thoughts on how I might go about this? I played around a lot with requireConfig.json with paths, shims, dependencies but nothing worked.