mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Add @license to minified copyright header to preserve it in case of double minification. [closes #138]
Former-commit-id: 6c9b72f9c807daac613ff2d4339c0e3c4e7cafe3
This commit is contained in:
5
build.js
5
build.js
@@ -415,7 +415,7 @@
|
||||
* @returns {String} Returns the modified source.
|
||||
*/
|
||||
function addCommandsToHeader(source, commands) {
|
||||
return source.replace(/(\/\*!\n)( \*)?( *Lo-Dash [\w.-]+)(.*)/, function() {
|
||||
return source.replace(/(\/\*!\n)( \*)?( *@license[\s*]+)?( *Lo-Dash [\w.-]+)(.*)/, function() {
|
||||
// convert unmatched groups to empty strings
|
||||
var parts = _.map(slice.call(arguments, 1), function(part) {
|
||||
return part || '';
|
||||
@@ -436,7 +436,8 @@
|
||||
});
|
||||
// add build commands to copyright/license header
|
||||
return (
|
||||
parts[0] + parts[1] + parts[2] + ' (Custom Build)' + parts[3] + '\n' +
|
||||
parts[0] + parts[1] + parts[2] + parts[3] +
|
||||
' (Custom Build)' + parts[4] + '\n' +
|
||||
parts[1] + ' Build: `lodash ' + commands.join(' ') + '`'
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user