Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Wrap specified JavaScript documents in the Universal Module Definition (UMD) allowing them to run in AMD, Require.js, CommonJS/Node.js and Vanilla environments automatically
CoffeeScript JavaScript
branch: master

README.md

Universal Module Definition (UMD) Plugin for DocPad

Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Gratipay donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

Wrap specified JavaScript documents in the Universal Module Definition (UMD) allowing them to run in AMD, Require.js, CommonJS/Node.js, Ender and Vanilla environments automatically

Install

docpad install umd

Usage

For the documents that you want to be wrapped inside UMD, specify umd: true inside your document's meta data header like so:

---
umd: true
---

// your javascript content

and it will be transformed into:

/*global define:false require:false */
(function (name, context, definition) {
    if (typeof module !== 'undefined' && module.exports) module.exports = definition();
    else if (typeof define === 'function' && define.amd) define(definition);
    else if (typeof provide === 'function') provide(name, definition());
    else context[name] = definition();
})('the-javascript-file-basename', this, function(){
    // your javascript content
});

History

Discover the change history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Gratipay donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Licensed under the incredibly permissive MIT license

Copyright © Bevry Pty Ltd us@bevry.me (http://bevry.me)

Something went wrong with that request. Please try again.