allow whitespace after define(

pull/149/head
nightwing 2015-09-08 20:50:53 +04:00
rodzic 70194ede7f
commit 1de84e810d
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -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);