Skip to content

Instantly share code, notes, and snippets.

@aackerman
Last active December 10, 2015 20:38
Show Gist options
  • Save aackerman/4489606 to your computer and use it in GitHub Desktop.
Save aackerman/4489606 to your computer and use it in GitHub Desktop.
Leaflet gist
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
</head>
<body>
<script src="//requirejs.org/docs/release/2.1.2/minified/require.js"></script>
<script>
requirejs.config({
paths: {
'leaflet': '/js/leaflet',
'leaflet.markercluster': '/js/plugins/leaflet.markercluster'
},
shim: {
'leaflet.markercluster': {
deps: ['leaflet']
}
}
});
require([
'main-lib'
], function(
MainLib
){
});
</script>
</body>
</html>
define([
'other-libs'
'leaflet.markercluster'
], function(
OtherLibs
){})
@aackerman
Copy link
Author

So the main lib would require all the leaflet plugins to be loaded, the plugins would be shimmed to have leaflet as a dep. Let me know if this make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment