Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

Support Simplified CommonJS Wrappers #33

Closed
wants to merge 1 commit into from

Conversation

stasm
Copy link
Contributor

@stasm stasm commented Jun 12, 2013

Add explicit support for CJS Wrappers which look like the following:

define(function(require, exports, module){
    var foo = require('foo'),
        bar = require('foo/bar');

    exports.doSomething = function(){
        console.log(foo + bar);
    };
});

A module is only treated as a CJS module if it doesn't contain a dependency array and the definition function contains at least one parameter.

More information:

Add explicit support for CJS Wrappers which look like the following:

    define(function(require, exports, module){
        var foo = require('foo'),
            bar = require('foo/bar');

        exports.doSomething = function(){
            console.log(foo + bar);
        };
    });

A module is only treated as a CJS module if it doesn't contain a dependency
array and the definition function contain at least one parameter.

More information:

    http://requirejs.org/docs/api.html#cjsmodule
    https://github.com/jrburke/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define
@joewalker
Copy link
Member

Pulled to my branch - will merge to mozilla later.

@joewalker joewalker closed this Jun 17, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants