From 64f904dd0ec423c302567369db6942344da7a422 Mon Sep 17 00:00:00 2001 From: "S. Andrew Sheppard" Date: Tue, 21 Oct 2014 12:32:06 -0500 Subject: [PATCH] simplify AMD definition --- PLUGIN-GUIDE.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PLUGIN-GUIDE.md b/PLUGIN-GUIDE.md index d0d33e16..dfd0cede 100644 --- a/PLUGIN-GUIDE.md +++ b/PLUGIN-GUIDE.md @@ -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. \ No newline at end of file +Now your plugin is available as an AMD and CommonJS module and can used used in module loaders like Browserify and RequireJS.