about summary refs log tree commit diff
path: root/web
diff options
context:
space:
mode:
authorMichael Staub <michael.staub@brightmachines.com>2023-02-23 16:32:56 -0800
committerMichael Staub <michael.staub@brightmachines.com>2023-02-23 16:32:56 -0800
commitc173cffd62c777781d369b17121cd865678fcd05 (patch)
tree6a27d785cff919bdf78f5b1c929c545fb76ae6fa /web
parente11f360376e3671749c066e767d50956e0ef7ff9 (diff)
downloadvoidsky-c173cffd62c777781d369b17121cd865678fcd05.tar.zst
fix: webpack hot reloading
Diffstat (limited to 'web')
-rw-r--r--web/webpack.config.js21
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',