metro-bundler: fix percent progress output

Reviewed By: davidaurelio

Differential Revision: D5236226

fbshipit-source-id: efbbf46f4212a66a6357b7d87059f89354b6f50b
This commit is contained in:
Jean Lauliac 2017-06-13 08:35:47 -07:00 committed by Facebook Github Bot
parent d3195fa528
commit 626fe47667
1 changed files with 4 additions and 4 deletions

View File

@ -101,16 +101,16 @@ class TerminalReporter {
): string { ): string {
const localPath = path.relative('.', bundleOptions.entryFile); const localPath = path.relative('.', bundleOptions.entryFile);
return util.format( return util.format(
'Bundling `%s` %s%s% (%s/%s)%s %s, %s, %s', 'Bundling `%s` [%s, %s, %s] %s%s%% (%s/%s)%s',
localPath, localPath,
bundleOptions.dev ? 'development' : 'production',
bundleOptions.minify ? 'minified' : 'non-minified',
bundleOptions.hot ? 'hmr enabled' : 'hmr disabled',
phase === 'in_progress' ? getProgressBar(ratio, 16) + ' ' : '', phase === 'in_progress' ? getProgressBar(ratio, 16) + ' ' : '',
(100 * ratio).toFixed(1), (100 * ratio).toFixed(1),
transformedFileCount, transformedFileCount,
totalFileCount, totalFileCount,
phase === 'done' ? ', done.' : (phase === 'failed' ? ', failed.' : ''), phase === 'done' ? ', done.' : (phase === 'failed' ? ', failed.' : ''),
bundleOptions.dev ? 'development' : 'production',
bundleOptions.minify ? 'minified' : 'non-minified',
bundleOptions.hot ? 'hmr enabled' : 'hmr disabled',
); );
} }