From c173cffd62c777781d369b17121cd865678fcd05 Mon Sep 17 00:00:00 2001 From: Michael Staub Date: Thu, 23 Feb 2023 16:32:56 -0800 Subject: fix: webpack hot reloading --- web/webpack.config.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'web/webpack.config.js') diff --git a/web/webpack.config.js b/web/webpack.config.js index e41f0a148..18056190d 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -81,6 +81,27 @@ module.exports = { ], }, + devServer: { + historyApiFallback: { + rewrites: [ + {from: /.*\/bundle.web.js/, to: '/bundle.web.js'}, + { + from: /.*^\/(.*.hot-update.json)$/, + to: function (context) { + return '/' + context.parsedUrl.pathname.split('/').pop() + }, + }, + { + from: /.*^\/(.*.hot-update.js)$/, + to: function (context) { + return '/' + context.parsedUrl.pathname.split('/').pop() + }, + }, + {from: /.*/, to: '/index.html'}, + ], + }, + }, + resolve: { alias: { 'react-native$': 'react-native-web', -- cgit 1.4.1