Fork-ts-checker-webpack-plugin: Don't print info when running webpack --json

Created on 26 Feb 2018  路  5Comments  路  Source: TypeStrong/fork-ts-checker-webpack-plugin

Version: 0.3.0

Running webpack --profile --json currently produces the following when fork-ts-checker-webpack-plugin is included:

Starting type checking service...
Using 1 worker with 2048MB memory limit
{
  "errors": [],
  "warnings": [],
  "version": "3.10.0",
  "hash": "8c0541347f7cefe0876b",
...

The first two lines cause e.g. webpack-bundle-analyzer to fail.

When webpack is ran with --json, nothing should be written to console.

bug

Most helpful comment

Got the same problem, this works for me:

new ForkTsCheckerWebpackPlugin({tsconfig: 'tsconfig.json', silent: process.argv.includes('--json')}),

All 5 comments

We had this same issue in ts-loader for ages. In the end we bowed to peer pressure and dialed down our logging to not emit by default. Before that we had a --silent option which nixed it - people could use that and did. Maybe worth introducing a similar option?

yep, same issue here. Are you all accepting PRs?

I just found the silent option. Looks like it does what I want.

Got the same problem, this works for me:

new ForkTsCheckerWebpackPlugin({tsconfig: 'tsconfig.json', silent: process.argv.includes('--json')}),

@geirsagberg , @meyer , @Akuukis
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which should resolve this issue 馃殌
I will close this issue to clean-up the backlog :)

Was this page helpful?
0 / 5 - 0 ratings