diff --git a/node_modules/architect-build/module-deps.js b/node_modules/architect-build/module-deps.js index 107a4420..083429bd 100644 --- a/node_modules/architect-build/module-deps.js +++ b/node_modules/architect-build/module-deps.js @@ -279,7 +279,7 @@ function getReqDeps(src, name) { }); } function getAmdDeps(src, name) { - var m = src.match(/define\(\[[^\]]+\]/gm); + var m = src.match(/define\(\s*\[[^\]]+\]/gm); if (!m) return []; @@ -360,12 +360,12 @@ function removeLicenceCommentsKeepLines(module) { function wrapUMD(module) { if (module.loaderModule || module.noRequire) return; - var firstDefineCall = module.source.match(/define\([^)]*/); + var firstDefineCall = module.source.match(/define\(\s*[^)]*/); if (firstDefineCall) { // check if it is a normal define or some crazy umd trick - if (/define\(function\s*\(/.test(firstDefineCall[0])) + if (/define\(\s*function\s*\(/.test(firstDefineCall[0])) return; - if (/define\(\[[^\]]*\],\s*function\(/.test(firstDefineCall[0])) + if (/define\(\s*\[[^\]]*\],\s*function\(/.test(firstDefineCall[0])) return; } console.log("wrapping module " + module.id);