2016-05-16 13:33:49 +02:00
|
|
|
'use strict';
|
|
|
|
|
2017-05-13 13:25:33 +02:00
|
|
|
const _ = require('lodash');
|
|
|
|
const async = require('async');
|
|
|
|
const path = require('path');
|
2016-05-16 13:33:49 +02:00
|
|
|
|
2017-05-13 13:25:33 +02:00
|
|
|
const file = require('../common/file');
|
|
|
|
const util = require('../common/util');
|
2016-05-16 13:33:49 +02:00
|
|
|
|
2017-05-13 13:25:33 +02:00
|
|
|
const basePath = path.join(__dirname, '..', '..');
|
|
|
|
const distPath = path.join(basePath, 'dist');
|
2016-05-16 13:33:49 +02:00
|
|
|
|
2017-05-13 13:25:33 +02:00
|
|
|
const filePairs = [
|
2016-05-16 13:33:49 +02:00
|
|
|
[path.join(distPath, 'lodash.core.js'), 'core.js'],
|
|
|
|
[path.join(distPath, 'lodash.core.min.js'), 'core.min.js'],
|
|
|
|
[path.join(distPath, 'lodash.min.js'), 'lodash.min.js']
|
|
|
|
];
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2017-05-13 13:25:33 +02:00
|
|
|
/**
|
|
|
|
* Creates supplementary Lodash modules at the `target` path.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @param {string} target The output directory path.
|
|
|
|
*/
|
2016-05-16 13:33:49 +02:00
|
|
|
function build(target) {
|
2017-05-13 13:25:33 +02:00
|
|
|
const actions = _.map(filePairs, pair =>
|
|
|
|
file.copy(pair[0], path.join(target, pair[1])));
|
2016-05-16 13:33:49 +02:00
|
|
|
|
2017-05-13 13:25:33 +02:00
|
|
|
async.series(actions, util.pitch);
|
2016-05-16 13:33:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
build(_.last(process.argv));
|