From d195ec6f9d0f5cf6411788ccbbb4eed1584104e0 Mon Sep 17 00:00:00 2001 From: a-morales Date: Mon, 28 Nov 2016 09:25:20 -0800 Subject: [PATCH] add verbose flag to react-scripts start command --- packages/react-scripts/scripts/start.js | 6 ++++++ packages/react-scripts/template/README.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/packages/react-scripts/scripts/start.js b/packages/react-scripts/scripts/start.js index 752bd8a08a8..03f77a2f4a6 100644 --- a/packages/react-scripts/scripts/start.js +++ b/packages/react-scripts/scripts/start.js @@ -60,6 +60,12 @@ if (isSmokeTest) { }; } +// Disabling clearing of console +var isVerbose = process.argv.some(arg => arg.indexOf('--verbose') > -1); +if (isVerbose) { + clearConsole = function() { return; }; +} + function setupCompiler(host, port, protocol) { // "Compiler" is a low-level interface to Webpack. // It lets us listen to some events and provide our own custom messages. diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 48409092a27..480559c1418 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -125,6 +125,8 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.
You will also see any lint errors in the console. +If you don't want the console to be cleared on reload, you can invoke `npm start --verbose` + ### `npm test` Launches the test runner in the interactive watch mode.