Created
May 26, 2020 14:46
-
-
Save jaredpalmer/d3016701589f14df8a3572df91a5754b to your computer and use it in GitHub Desktop.
Speed up Create React App with TypeScript in development
This file contains 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 25840d9..25c3c41 100644 | |
--- a/node_modules/react-scripts/config/webpack.config.js | |
+++ b/node_modules/react-scripts/config/webpack.config.js | |
@@ -172,7 +172,7 @@ module.exports = function(webpackEnv) { | |
// The build folder. | |
path: isEnvProduction ? paths.appBuild : undefined, | |
// Add /* filename */ comments to generated require()s in the output. | |
- pathinfo: isEnvDevelopment, | |
+ pathinfo: false, | |
// There will be one main bundle, and one file per asynchronous chunk. | |
// In development, it does not produce real files. | |
filename: isEnvProduction | |
@@ -270,10 +270,14 @@ module.exports = function(webpackEnv) { | |
// Automatically split vendor and commons | |
// https://twitter.com/wSokra/status/969633336732905474 | |
// https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366 | |
- splitChunks: { | |
+ splitChunks: isEnvDevelopment ? false : { | |
chunks: 'all', | |
name: false, | |
}, | |
+ removeAvailableModules: isEnvDevelopment && false, | |
+ removeEmptyChunks: isEnvDevelopment && false, | |
+ | |
+ | |
// Keep the runtime chunk separated to enable long term caching | |
// https://twitter.com/wSokra/status/969679223278505985 | |
// https://github.com/facebook/create-react-app/issues/5358 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment