about summary refs log tree commit diff
path: root/config/webpack
diff options
context:
space:
mode:
authorNolan Lawson <nolan@nolanlawson.com>2017-10-07 17:55:58 -0700
committerEugen Rochko <eugen@zeonfederated.com>2017-10-08 02:55:58 +0200
commit7de6d269d21e0ed7a3ede7c3d17089726a29d841 (patch)
tree917fab8d5e9e8d3bb37c154e11c56532fad7789c /config/webpack
parent684001d729a4684ab00a24e31ec39f8cae6e37a7 (diff)
Use ES module build of react-router-dom (#5264)
Diffstat (limited to 'config/webpack')
-rw-r--r--config/webpack/shared.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/config/webpack/shared.js b/config/webpack/shared.js
index ea2da6aa7..cd642a28a 100644
--- a/config/webpack/shared.js
+++ b/config/webpack/shared.js
@@ -48,6 +48,13 @@ module.exports = {
 
   plugins: [
     new webpack.EnvironmentPlugin(JSON.parse(JSON.stringify(env))),
+    new webpack.NormalModuleReplacementPlugin(
+      /^history\//, (resource) => {
+        // temporary fix for https://github.com/ReactTraining/react-router/issues/5576
+        // to reduce bundle size
+        resource.request = resource.request.replace(/^history/, 'history/es');
+      }
+    ),
     new ExtractTextPlugin(env.NODE_ENV === 'production' ? '[name]-[hash].css' : '[name].css'),
     new ManifestPlugin({
       publicPath: output.publicPath,