mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Recursively add props and vars to include in the build in build.js.
Former-commit-id: fe7b8cad6ee6df1443424e05836e00a81f532af8
This commit is contained in:
37
build.js
37
build.js
@@ -2860,19 +2860,34 @@
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
if (!isNoDep) {
|
if (!isNoDep) {
|
||||||
// additional variables to include in the build
|
(function() {
|
||||||
includeProps = _.uniq(_.transform(propDependencyMap, function(result, propNames, funcName) {
|
function expand(result, depMap, funcNames, stack) {
|
||||||
if (_.contains(buildFuncs, funcName)) {
|
stack || (stack = []);
|
||||||
push.apply(result, propNames);
|
return _.uniq(_.transform(funcNames || depMap, function(result, identifiers, funcName) {
|
||||||
}
|
// juggle arguments
|
||||||
}, includeProps));
|
if (funcNames) {
|
||||||
|
funcName = identifiers;
|
||||||
|
identifiers = depMap[funcName] || [];
|
||||||
|
}
|
||||||
|
if (!_.contains(stack, funcName) && _.contains(buildFuncs, funcName)) {
|
||||||
|
var deps = _.uniq(_.transform(identifiers, function(deps, identifier) {
|
||||||
|
push.apply(deps, getDependencies(identifier));
|
||||||
|
}));
|
||||||
|
|
||||||
// additional properties to include in the build
|
stack.push(funcName);
|
||||||
includeVars = _.uniq(_.transform(varDependencyMap, function(result, varNames, funcName) {
|
push.apply(result, identifiers);
|
||||||
if (_.contains(buildFuncs, funcName)) {
|
|
||||||
push.apply(result, varNames);
|
buildFuncs = _.union(buildFuncs, deps);
|
||||||
|
expand(result, depMap, deps);
|
||||||
|
}
|
||||||
|
}, result));
|
||||||
}
|
}
|
||||||
}, includeVars));
|
// add properties to include in the build
|
||||||
|
expand(includeProps, propDependencyMap);
|
||||||
|
|
||||||
|
// add variables to include in the build
|
||||||
|
expand(includeVars, varDependencyMap);
|
||||||
|
}());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user