1'use strict'; 2 3const _ = require('lodash'); 4const async = require('async'); 5const path = require('path'); 6 7const file = require('../common/file'); 8const util = require('../common/util'); 9 10const basePath = path.join(__dirname, '..', '..'); 11const distPath = path.join(basePath, 'dist'); 12 13const filePairs = [ 14 [path.join(distPath, 'lodash.core.js'), 'core.js'], 15 [path.join(distPath, 'lodash.core.min.js'), 'core.min.js'], 16 [path.join(distPath, 'lodash.min.js'), 'lodash.min.js'] 17]; 18 19/*----------------------------------------------------------------------------*/ 20 21/** 22 * Creates supplementary Lodash modules at the `target` path. 23 * 24 * @private 25 * @param {string} target The output directory path. 26 */ 27function build(target) { 28 const actions = _.map(filePairs, pair => 29 file.copy(pair[0], path.join(target, pair[1]))); 30 31 async.series(actions, util.pitch); 32} 33 34build(_.last(process.argv)); 35