From 60508afc56609e0dc558cfb3cec12a1b10bb8aee Mon Sep 17 00:00:00 2001 From: James Pike Date: Tue, 15 Jan 2019 23:41:48 +0000 Subject: [PATCH] Run ForkTsCheckerWebpackPlugin with async when CI env is used --- packages/react-scripts/config/webpack.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index a5f147ce0ef..b4c6307ec4b 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -43,6 +43,7 @@ const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false'; // Check if TypeScript is setup const useTypeScript = fs.existsSync(paths.appTsConfig); +const asyncTsFork = useTypeScript && process.env.CI && process.env.CI !== 'false'; // style files regexes const cssRegex = /\.css$/; @@ -617,7 +618,7 @@ module.exports = function(webpackEnv) { typescript: resolve.sync('typescript', { basedir: paths.appNodeModules, }), - async: false, + async: asyncTsFork, checkSyntacticErrors: true, tsconfig: paths.appTsConfig, compilerOptions: { @@ -637,7 +638,7 @@ module.exports = function(webpackEnv) { '!**/src/setupTests.*', ], watch: paths.appSrc, - silent: true, + silent: !asyncTsFork, formatter: typescriptFormatter, }), ].filter(Boolean),