Skip to content

Commit 5b62c2e

Browse files
authored
Inline the webpack runtime chunk (facebook#5058)
1 parent a1566c6 commit 5b62c2e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

config/webpack.config.prod.js

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const autoprefixer = require('autoprefixer');
1212
const path = require('path');
1313
const webpack = require('webpack');
1414
const HtmlWebpackPlugin = require('html-webpack-plugin');
15+
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
1516
const TerserPlugin = require('terser-webpack-plugin');
1617
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
1718
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
@@ -433,6 +434,9 @@ module.exports = {
433434
minifyURLs: true,
434435
},
435436
}),
437+
// Inlines the webpack runtime script. This script is too small to warrant
438+
// a network request.
439+
new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime~.+[.]js/]),
436440
// Makes some environment variables available in index.html.
437441
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
438442
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">

0 commit comments

Comments
 (0)