diff --git a/lib/dryice/index.js b/lib/dryice/index.js index 55a8942..736ea18 100644 --- a/lib/dryice/index.js +++ b/lib/dryice/index.js @@ -858,10 +858,21 @@ function findRequires(module) { else if (args[0][0] === 'string' && args[1][0] == 'array') { params = args[1][1]; } + // Check if it's a Simplified CommonJS Wrapper. 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. + // http://requirejs.org/docs/api.html#cjsmodule + else if ((args[0][0] === 'function' && args[0][2].length) || + (args[1][0] === 'function' && args[1][2].length && + args[0][0] === 'string')) { + // By definition there are no dependencies, so no more work is + // necessary. + return; + } else { /* console.log('- ' + module.path + ' has define(...) ' + - 'with non-array parameter. Ignoring requirement.'); + 'with unrecognized parameter. Ignoring requirement.'); */ return; }