diff --git a/build.js b/build.js index 1ef5555bd..f10bad5be 100755 --- a/build.js +++ b/build.js @@ -1082,6 +1082,9 @@ source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasObjectSpliceBug;|.+?hasObjectSpliceBug *=.+/g, ''); } + // remove pseudo private properties + source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n'); + // assign debug source before further modifications that rely on the minifier // to remove unused variables and other dead code debugSource = source; @@ -1136,9 +1139,6 @@ source = source.replace(/ *\(function\(\) *{[\s\S]+?}\(1\)\);/, ''); } - // remove pseudo private properties - source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n'); - // consolidate consecutive horizontal rule comment separators source = source.replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) { return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*'));