diff options
author | Michael Staub <michael.staub@brightmachines.com> | 2023-02-23 16:32:56 -0800 |
---|---|---|
committer | Michael Staub <michael.staub@brightmachines.com> | 2023-02-23 16:32:56 -0800 |
commit | c173cffd62c777781d369b17121cd865678fcd05 (patch) | |
tree | 6a27d785cff919bdf78f5b1c929c545fb76ae6fa /web | |
parent | e11f360376e3671749c066e767d50956e0ef7ff9 (diff) | |
download | voidsky-c173cffd62c777781d369b17121cd865678fcd05.tar.zst |
fix: webpack hot reloading
Diffstat (limited to 'web')
-rw-r--r-- | web/webpack.config.js | 21 |
1 files changed, 21 insertions, 0 deletions
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', |