From 9cccde927f2029739e058d6977e6858957395c7d Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 7 Dec 2017 22:47:56 +0000 Subject: [PATCH] Add `yarn build --pretty` (#11801) --- scripts/rollup/build.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index bc58d8678a..5ed79452b0 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -51,6 +51,7 @@ const requestedBundleTypes = (argv.type || '') const requestedBundleNames = (argv._[0] || '') .split(',') .map(type => type.toLowerCase()); +const forcePrettyOutput = argv['pretty']; const syncFBSourcePath = argv['sync-fbsource']; const syncWWWPath = argv['sync-www']; const shouldExtractErrors = argv['extract-errors']; @@ -191,7 +192,7 @@ function getPlugins( const isInGlobalScope = bundleType === UMD_DEV || bundleType === UMD_PROD; const isFBBundle = bundleType === FB_DEV || bundleType === FB_PROD; const isRNBundle = bundleType === RN_DEV || bundleType === RN_PROD; - const shouldStayReadable = isFBBundle || isRNBundle; + const shouldStayReadable = isFBBundle || isRNBundle || forcePrettyOutput; return [ // Extract error codes from invariant() messages into a file. shouldExtractErrors && { @@ -471,7 +472,9 @@ async function buildEverything() { } console.log(Stats.printResults()); - Stats.saveResults(); + if (!forcePrettyOutput) { + Stats.saveResults(); + } if (shouldExtractErrors) { console.warn(