From acd975f03c97cfd655fbe47a263fdfcb24b057bf Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 5 Mar 2017 16:43:34 +0000 Subject: [PATCH] Fix hot reloading for WebpackDevServer after eject (#1721) --- packages/react-scripts/config/webpack.config.dev.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index a72e47a5b74..0e75ad833bf 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -137,7 +137,13 @@ module.exports = function(publicPath) { { exclude: [ /\.html$/, - /\.(js|jsx)$/, + // We have to write /\.(js|jsx)(\?.*)?$/ rather than just /\.(js|jsx)$/ + // because you might change the hot reloading server from the custom one + // to Webpack's built-in webpack-dev-server/client?/, which would not + // get properly excluded by /\.(js|jsx)$/ because of the query string. + // Webpack 2 fixes this, but for now we include this hack. + // https://github.com/facebookincubator/create-react-app/issues/1713 + /\.(js|jsx)(\?.*)?$/, /\.css$/, /\.json$/, /\.svg$/