Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Speed up Create React App with TypeScript in development
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