mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Make build-module create core.min.js and lodash.min.js.
This commit is contained in:
@@ -1,12 +1,19 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var _ = require('lodash'),
|
var _ = require('lodash'),
|
||||||
fs = require('fs-extra'),
|
async = require('async'),
|
||||||
path = require('path');
|
path = require('path');
|
||||||
|
|
||||||
|
var util = require('../common/util');
|
||||||
|
|
||||||
var basePath = path.join(__dirname, '..', '..'),
|
var basePath = path.join(__dirname, '..', '..'),
|
||||||
distPath = path.join(basePath, 'dist'),
|
distPath = path.join(basePath, 'dist');
|
||||||
corePath = path.join(distPath, 'lodash.core.js');
|
|
||||||
|
var filePairs = [
|
||||||
|
[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']
|
||||||
|
];
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@@ -17,7 +24,11 @@ function onComplete(error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function build(target) {
|
function build(target) {
|
||||||
fs.copy(corePath, path.join(target, 'core.js'), onComplete);
|
var actions = _.map(filePairs, function(pair) {
|
||||||
|
return util.copyFile(pair[0], path.join(target, pair[1]));
|
||||||
|
});
|
||||||
|
|
||||||
|
async.series(actions, onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
build(_.last(process.argv));
|
build(_.last(process.argv));
|
||||||
|
|||||||
Reference in New Issue
Block a user