Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module loaders + Publishing on NPM #2955

Merged
merged 3 commits into from
Oct 18, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix spelling
  • Loading branch information
patrickarlt committed Oct 15, 2014
commit 957097cd2a9850f3daa2d114894bc83364359245
6 changes: 3 additions & 3 deletions PLUGIN-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ Here is an example of a `package.json` file for a Leaflet plugin.

## Module Loaders

Module loaders such as [RequireJS](http://requirejs.org/) and [Browserify](http://browserify.org/) impliment module systems like AMD (Asyncronous Module Definition) and CommonJS to allow developers to modularize and load their code.
Module loaders such as [RequireJS](http://requirejs.org/) and [Browserify](http://browserify.org/) implement module systems like AMD (Asynchronous Module Definition) and CommonJS to allow developers to modularize and load their code.

You can add support for AMD/CommonJS loaders to your Leaflet plugin by follwoing this pattern based on the [Universal Module Definition](https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js)
You can add support for AMD/CommonJS loaders to your Leaflet plugin by following this pattern based on the [Universal Module Definition](https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js)

```js
(function (factory, window) {
Expand All @@ -179,7 +179,7 @@ You can add support for AMD/CommonJS loaders to your Leaflet plugin by follwoing
}
}(function (L) {
var MyLeafletPlugin = {};
// impliment your plguin
// implement your plugin

// return your plugin when you are done
return MyLeafletPlugin;
Expand Down