Last active
December 10, 2015 20:38
-
-
Save aackerman/4489606 to your computer and use it in GitHub Desktop.
Leaflet gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'other-libs' | |
'leaflet.markercluster' | |
], function( | |
OtherLibs | |
){}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.