From 441995fa6ad78ecae5cdbfee1d1cc46cc17d32e3 Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Tue, 3 Nov 2015 01:19:15 -0800 Subject: [PATCH] Log minification time Summary: public Add an activity to log minification time. Reviewed By: vjeux Differential Revision: D2604863 fb-gh-sync-id: cbdf0297f0611c87b589b87928af235f9ba81172 --- packager/react-packager/src/Bundler/Bundle.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packager/react-packager/src/Bundler/Bundle.js b/packager/react-packager/src/Bundler/Bundle.js index a441aa3c1..bf4edc328 100644 --- a/packager/react-packager/src/Bundler/Bundle.js +++ b/packager/react-packager/src/Bundler/Bundle.js @@ -12,6 +12,7 @@ const _ = require('underscore'); const base64VLQ = require('./base64-vlq'); const UglifyJS = require('uglify-js'); const ModuleTransport = require('../lib/ModuleTransport'); +const Activity = require('../Activity'); const SOURCEMAPPING_URL = '\n\/\/@ sourceMappingURL='; @@ -128,11 +129,13 @@ class Bundle { const source = this._getSource(); try { + const minifyActivity = Activity.startEvent('minify'); this._minifiedSourceAndMap = UglifyJS.minify(source, { fromString: true, outSourceMap: 'bundle.js', inSourceMap: this.getSourceMap(), }); + Activity.endEvent(minifyActivity); return this._minifiedSourceAndMap; } catch(e) { // Sometimes, when somebody is using a new syntax feature that we