Skip to content

Commit

Permalink
FIX support either NO_COLOR or FORCE_COLOR=0 to turn off color
Browse files Browse the repository at this point in the history
  • Loading branch information
kikonen committed Dec 5, 2019
1 parent 6e92e52 commit 6602406
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cli/logging.ts
Expand Up @@ -2,6 +2,12 @@ import tc from 'turbocolor';
import { RollupError } from '../src/rollup/types';
import relativeId from '../src/utils/relativeId';

// @see https://no-color.org
// @see https://www.npmjs.com/package/chalk
if (process.env.FORCE_COLOR === '0' || process.env.NO_COLOR) {
tc.enabled = false;
}

// log to stderr to keep `rollup main.js > bundle.js` from breaking
export const stderr = console.error.bind(console);

Expand Down

0 comments on commit 6602406

Please sign in to comment.