mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Cleanup fp/build-modules.
This commit is contained in:
@@ -87,6 +87,8 @@ function onComplete(error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function build(target) {
|
function build(target) {
|
||||||
|
target = path.resolve(target);
|
||||||
|
|
||||||
var fpPath = path.join(target, 'fp');
|
var fpPath = path.join(target, 'fp');
|
||||||
|
|
||||||
// Glob existing lodash module paths.
|
// Glob existing lodash module paths.
|
||||||
@@ -100,14 +102,14 @@ function build(target) {
|
|||||||
// Add FP alias and remapped module paths.
|
// Add FP alias and remapped module paths.
|
||||||
_.each([mapping.aliasToReal, mapping.remap], function(data) {
|
_.each([mapping.aliasToReal, mapping.remap], function(data) {
|
||||||
_.forOwn(data, function(realName, alias) {
|
_.forOwn(data, function(realName, alias) {
|
||||||
if (!_.startsWith(alias, '_')) {
|
var modulePath = path.join(target, alias + '.js');
|
||||||
modulePaths.push(path.join(target, alias + '.js'));
|
if (!_.startsWith(alias, '_') &&
|
||||||
|
!_.includes(modulePaths, modulePath)) {
|
||||||
|
modulePaths.push(modulePath);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modulePaths = _.uniq(modulePaths);
|
|
||||||
|
|
||||||
var actions = modulePaths.map(function(modulePath) {
|
var actions = modulePaths.map(function(modulePath) {
|
||||||
var moduleName = path.basename(modulePath, '.js');
|
var moduleName = path.basename(modulePath, '.js');
|
||||||
return writeFile(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
|
return writeFile(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
|
||||||
|
|||||||
Reference in New Issue
Block a user