From bd70d31a7236bc476bafa1033983b9aba58f2150 Mon Sep 17 00:00:00 2001 From: Kit Cambridge Date: Mon, 23 Apr 2012 13:34:38 -0600 Subject: [PATCH] `build.js`: Print compression status messages to the console. Former-commit-id: 07524fbba01e45f0e51f24b61081527e59cb0006 --- build.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.js b/build.js index f9d5dcffc..7f8b53781 100755 --- a/build.js +++ b/build.js @@ -120,6 +120,8 @@ throw exception; } + console.log("Compressing Lodash using the Closure Compiler..."); + // post-process the compiled source compiledSource = postprocess(compiledSource); @@ -138,6 +140,8 @@ // explicit `binary` encoding is necessary to ensure that the stream is written correctly fs.writeFileSync(path.join(distPath, 'lodash.compiler.js.gz'), result, 'binary'); + console.log("Done. Size: %d KB.", compiledSize); + // compress Lo-Dash using UglifyJS var ugly = uglifyJS.uglify, uglifiedSource = ugly.gen_code( @@ -153,6 +157,8 @@ 'ascii_only': true }); + console.log("Compressing Lodash using UglifyJS..."); + // post-process the uglified source and split lines at 500 characters for // consistency with Closure Compiler uglifiedSource = postprocess(ugly.split_lines(uglifiedSource, 500)); @@ -168,6 +174,8 @@ var uglifiedSize = result.length; fs.writeFileSync(path.join(distPath, 'lodash.uglify.js.gz'), result, 'binary'); + console.log("Done. Size: %d KB.", uglifiedSize); + // select the smallest minified distribution and use it as the official // minified release fs.writeFileSync(path.join(__dirname, "lodash.min.js"), compiledSize < uglifiedSize ? compiledSource : uglifiedSource);