kopia lustrzana https://github.com/c9/core
allow whitespace after define(
rodzic
70194ede7f
commit
1de84e810d
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue