From 5b62c2e440fe414aed2dbb9757268a79f1e79624 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Fri, 21 Sep 2018 14:17:56 -0400 Subject: [PATCH] Inline the webpack runtime chunk (#5058) --- config/webpack.config.prod.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 8e39b30fca5..4da336ed925 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -12,6 +12,7 @@ const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); +const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin'); const TerserPlugin = require('terser-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); @@ -433,6 +434,9 @@ module.exports = { minifyURLs: true, }, }), + // Inlines the webpack runtime script. This script is too small to warrant + // a network request. + new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime~.+[.]js/]), // Makes some environment variables available in index.html. // The public URL is available as %PUBLIC_URL% in index.html, e.g.: //