mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
No longer create/use the dist/ folder during the build process.
Former-commit-id: d8d298d5ce21032542d21c4d4fbc7e0112f6ad65
This commit is contained in:
15
build.js
15
build.js
@@ -1410,8 +1410,8 @@
|
||||
/(?:category|exclude|exports|iife|include|minus|plus)=/.test(options) ||
|
||||
!_.isEqual(exportsOptions, exportsAll);
|
||||
|
||||
// used to name temporary files created in `dist/`
|
||||
var workingName = outputPath
|
||||
// used as the basename of the output path
|
||||
var basename = outputPath
|
||||
? path.basename(outputPath, '.js')
|
||||
: 'lodash' + (isTemplate ? '.template' : isCustom ? '.custom' : '');
|
||||
|
||||
@@ -1424,18 +1424,17 @@
|
||||
stdout.write(debugSource);
|
||||
callback(debugSource);
|
||||
} else if (!isStdOut) {
|
||||
callback(debugSource, (isDebug && outputPath) || path.join(cwd, workingName + '.js'));
|
||||
callback(debugSource, (isDebug && outputPath) || path.join(cwd, basename + '.js'));
|
||||
}
|
||||
}
|
||||
// begin the minification process
|
||||
if (!isDebug) {
|
||||
if (!outputPath) {
|
||||
workingName += '.min';
|
||||
}
|
||||
outputPath || (outputPath = path.join(cwd, basename + '.min.js'));
|
||||
|
||||
minify(source, {
|
||||
'isSilent': isSilent,
|
||||
'isTemplate': isTemplate,
|
||||
'workingName': workingName,
|
||||
'outputPath': outputPath,
|
||||
'onComplete': function(source) {
|
||||
// correct overly aggressive Closure Compiler minification
|
||||
source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}');
|
||||
@@ -1448,7 +1447,7 @@
|
||||
stdout.write(source);
|
||||
callback(source);
|
||||
} else {
|
||||
callback(source, outputPath || path.join(cwd, workingName + '.js'));
|
||||
callback(source, outputPath);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user