From 93bd2fa954256e1debce425b3c9176462ce98098 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Mon, 27 Feb 2023 15:55:31 -0500 Subject: [PATCH 1/4] Node 16/17 and HMR support --- fixtures/flight/config/webpack.config.js | 9 +++++- fixtures/flight/package.json | 4 ++- fixtures/flight/server/global.js | 23 +++++++++----- fixtures/flight/server/region.js | 5 ++++ fixtures/flight/yarn.lock | 30 ++++++++++++++++++- .../src/ReactFlightWebpackNodeLoader.js | 6 ++-- 6 files changed, 64 insertions(+), 13 deletions(-) diff --git a/fixtures/flight/config/webpack.config.js b/fixtures/flight/config/webpack.config.js index f1579c3a7b7b0..9b4b7edb09c71 100644 --- a/fixtures/flight/config/webpack.config.js +++ b/fixtures/flight/config/webpack.config.js @@ -208,7 +208,13 @@ module.exports = function (webpackEnv) { : isEnvDevelopment && 'cheap-module-source-map', // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. - entry: paths.appIndexJs, + entry: isEnvProduction + ? [paths.appIndexJs] + : [ + paths.appIndexJs, + // HMR client + 'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000', + ], output: { // The build folder. path: paths.appBuild, @@ -571,6 +577,7 @@ module.exports = function (webpackEnv) { ].filter(Boolean), }, plugins: [ + new webpack.HotModuleReplacementPlugin(), // Generates an `index.html` file with the