@samitouri / QOS-React / commits / 9cccde927f

Add `yarn build --pretty` (#11801)

Dan Abramov committed Dec 7, 2017 at 22:47 UTC 9cccde927f2029739e058d6977e6858957395c7d
1 file changed +5 -2
scripts/rollup/build.js
+5 -2
@@ -51,6 +51,7 @@ const requestedBundleTypes = (argv.type || '')
51 const requestedBundleNames = (argv._[0] || '')
52 .split(',')
53 .map(type => type.toLowerCase());
54 +const forcePrettyOutput = argv['pretty'];
55 const syncFBSourcePath = argv['sync-fbsource'];
56 const syncWWWPath = argv['sync-www'];
57 const shouldExtractErrors = argv['extract-errors'];
@@ -191,7 +192,7 @@ function getPlugins(
192 const isInGlobalScope = bundleType === UMD_DEV || bundleType === UMD_PROD;
193 const isFBBundle = bundleType === FB_DEV || bundleType === FB_PROD;
194 const isRNBundle = bundleType === RN_DEV || bundleType === RN_PROD;
194 - const shouldStayReadable = isFBBundle || isRNBundle;
195 + const shouldStayReadable = isFBBundle || isRNBundle || forcePrettyOutput;
196 return [
197 // Extract error codes from invariant() messages into a file.
198 shouldExtractErrors && {
@@ -471,7 +472,9 @@ async function buildEverything() {
472 }
473
474 console.log(Stats.printResults());
474 - Stats.saveResults();
475 + if (!forcePrettyOutput) {
476 + Stats.saveResults();
477 + }
478
479 if (shouldExtractErrors) {
480 console.warn(