Skip to content

Commit 1d694b5

Browse files
committed
feat(typescript): add skip typecheck env
add SKIP_TYPE_CHECK env to disable typescript type checking fix facebook#5784
1 parent 8944aab commit 1d694b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: packages/react-scripts/config/webpack.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
4444
// Check if TypeScript is setup
4545
const useTypeScript = fs.existsSync(paths.appTsConfig);
4646

47+
// Skip TypeScript type checking
48+
const typeCheckTypeScript =
49+
useTypeScript && !(process.env.SKIP_TYPE_CHECK === 'true');
50+
4751
// style files regexes
4852
const cssRegex = /\.css$/;
4953
const cssModuleRegex = /\.module\.css$/;
@@ -620,7 +624,7 @@ module.exports = function(webpackEnv) {
620624
],
621625
}),
622626
// TypeScript type checking
623-
useTypeScript &&
627+
typeCheckTypeScript &&
624628
new ForkTsCheckerWebpackPlugin({
625629
typescript: resolve.sync('typescript', {
626630
basedir: paths.appNodeModules,

0 commit comments

Comments
 (0)