Created
July 22, 2019 00:51
-
-
Save sibelius/594a6b64656047e5f22f1363cd41aa87 to your computer and use it in GitHub Desktop.
react-scripts patch-package to avoid type checking on CRA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js | |
index 8f70442..dfd86d8 100644 | |
--- a/node_modules/react-scripts/config/webpack.config.js | |
+++ b/node_modules/react-scripts/config/webpack.config.js | |
@@ -47,6 +47,10 @@ const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false'; | |
// Check if TypeScript is setup | |
const useTypeScript = fs.existsSync(paths.appTsConfig); | |
+// Skip TypeScript type checking | |
+const typeCheckTypeScript = | |
+ useTypeScript && !(process.env.SKIP_TYPE_CHECK === 'true'); | |
+ | |
// style files regexes | |
const cssRegex = /\.css$/; | |
const cssModuleRegex = /\.module\.css$/; | |
@@ -629,7 +633,7 @@ module.exports = function(webpackEnv) { | |
], | |
}), | |
// TypeScript type checking | |
- useTypeScript && | |
+ typeCheckTypeScript && | |
new ForkTsCheckerWebpackPlugin({ | |
typescript: resolve.sync('typescript', { | |
basedir: paths.appNodeModules, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment