mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Fix failing build test and add another build test.
Former-commit-id: dccae3f43f55dda764750880e37c5e0682f32095
This commit is contained in:
15
build.js
15
build.js
@@ -2364,7 +2364,10 @@
|
|||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// used to specify creating a custom build
|
// flag used to track if `outputPath` has been used by `callback`
|
||||||
|
var outputUsed = false;
|
||||||
|
|
||||||
|
// flag used to specify creating a custom build
|
||||||
var isCustom = isLegacy || isMapped || isMobile || isModern || isStrict || isUnderscore ||
|
var isCustom = isLegacy || isMapped || isMobile || isModern || isStrict || isUnderscore ||
|
||||||
/(?:category|exclude|exports|iife|include|minus|plus)=/.test(options) ||
|
/(?:category|exclude|exports|iife|include|minus|plus)=/.test(options) ||
|
||||||
!_.isEqual(exportsOptions, exportsAll);
|
!_.isEqual(exportsOptions, exportsAll);
|
||||||
@@ -2384,8 +2387,12 @@
|
|||||||
}
|
}
|
||||||
if (isDebug && isStdOut) {
|
if (isDebug && isStdOut) {
|
||||||
stdout.write(debugSource);
|
stdout.write(debugSource);
|
||||||
callback(debugSource);
|
callback({
|
||||||
} else if (!isStdOut) {
|
'source': debugSource
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if (!isStdOut) {
|
||||||
|
outputUsed = true;
|
||||||
callback({
|
callback({
|
||||||
'source': debugSource,
|
'source': debugSource,
|
||||||
'outputPath': outputPath || path.join(cwd, basename + '.js')
|
'outputPath': outputPath || path.join(cwd, basename + '.js')
|
||||||
@@ -2394,7 +2401,7 @@
|
|||||||
}
|
}
|
||||||
// begin the minification process
|
// begin the minification process
|
||||||
if (!isDebug) {
|
if (!isDebug) {
|
||||||
if (outputPath && !isMinify) {
|
if (outputPath && outputUsed) {
|
||||||
outputPath = path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.min.js');
|
outputPath = path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.min.js');
|
||||||
} else if (!outputPath) {
|
} else if (!outputPath) {
|
||||||
outputPath = path.join(cwd, basename + '.min.js');
|
outputPath = path.join(cwd, basename + '.min.js');
|
||||||
|
|||||||
@@ -1030,7 +1030,8 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var commands = [
|
var commands = [
|
||||||
'-c',
|
'-c',
|
||||||
'--stdout'
|
'-c -d',
|
||||||
|
'--stdout',
|
||||||
];
|
];
|
||||||
|
|
||||||
commands.forEach(function(command, index) {
|
commands.forEach(function(command, index) {
|
||||||
@@ -1043,7 +1044,7 @@
|
|||||||
written = string;
|
written = string;
|
||||||
};
|
};
|
||||||
|
|
||||||
build([command, 'exports=', 'include='], function(data) {
|
build(['exports=', 'include='].concat(command.split(' ')), function(data) {
|
||||||
process.stdout.write = write;
|
process.stdout.write = write;
|
||||||
equal(written, data.source);
|
equal(written, data.source);
|
||||||
equal(arguments.length, 1);
|
equal(arguments.length, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user