simplify AMD definition
This commit is contained in:
parent
d93e828935
commit
64f904dd0e
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user