Pass empty dependency array for AMD to prevent dependency scanning #12

merged 1 commit into from Mar 24, 2014


None yet

4 participants

jrburke commented Jan 12, 2014

AMD loaders will scan for require('dep') style dependencies when just a factory function is passed to define (no dependency array). Now that projects may use CommonJS/Node modules internal to source function to generate the final exports, this is causing some undesired matching behavior, the AMD loader may also try to load modules for those require('dep') names.

Passing an empty dependency array, as this changeset does, avoids that factory function scanning and possible confusion around if the UMD-wrapped code has dependencies.

@jrburke jrburke referenced this pull request in requirejs/almond Jan 12, 2014

Does 'namespace' work with almond? #77

kebot commented Mar 24, 2014

+1, it will be helpful.


@jrburke @ForbesLindesay @substack This issue has affected Browerify and React. The latter contains require('dep') in comments.

 * Collection of methods that allow declaration and validation of props that are
 * supplied to React components. Example usage:
 *   var Props = require('ReactPropTypes');
 * ...
@ForbesLindesay ForbesLindesay merged commit bfad223 into ForbesLindesay:master Mar 24, 2014

1 check passed

default The Travis CI build passed
@kebot kebot referenced this pull request in reactjs/react-bower Jul 6, 2014

Pass empty dependency array for AMD. #3


Would you like to be added as a collaborator on this repository?

jrburke commented Feb 9, 2015

That is not necessary, the commit log is enough for me.

@jrburke jrburke referenced this pull request in cujojs/when Feb 10, 2015

Paths for lib modules not resolving #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment