Merge pull request #2962 from sheppard/patch-1

update AMD recommendation in plugin guide
This commit is contained in:
Patrick Arlt 2014-10-21 16:15:15 -07:00
commit 1f203fda69

View File

@ -163,9 +163,7 @@ You can add support for AMD/CommonJS loaders to your Leaflet plugin by following
// define an AMD module that relies on 'leaflet'
if (typeof define === 'function' && define.amd) {
define(['leaflet'], function (L) {
return (exports = factory(L));
});
define(['leaflet'], factory);
// define a Common JS module that relies on 'leaflet'
} else if (typeof exports === 'object') {
@ -186,4 +184,4 @@ You can add support for AMD/CommonJS loaders to your Leaflet plugin by following
}, window));
```
Now your plugin is available as an AMD and CommonJS module and can used used in module loaders like Browserify and RequireJS.
Now your plugin is available as an AMD and CommonJS module and can used used in module loaders like Browserify and RequireJS.