about summary refs log tree commit diff
path: root/webpack.config.js
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2023-09-05 19:13:42 +0100
committerGitHub <noreply@github.com>2023-09-05 11:13:42 -0700
commit9a3fa512ebcbf9e0b539dd337db967017b626826 (patch)
tree5463f970cbbb7e5192ddfbba26db68e7416905d2 /webpack.config.js
parent764c7cd5694a41c98d8543b68d7791fa90db4291 (diff)
downloadvoidsky-9a3fa512ebcbf9e0b539dd337db967017b626826.tar.zst
Enable Fast Refresh for web (#1383)
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 28e5ca0db..7515db8e9 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,6 @@
 const createExpoWebpackConfigAsync = require('@expo/webpack-config')
 const {withAlias} = require('@expo/webpack-config/addons')
+const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
 
 const reactNativeWebWebviewConfiguration = {
   test: /postMock.html$/,
@@ -22,5 +23,8 @@ module.exports = async function (env, argv) {
     ...(config.module.rules || []),
     reactNativeWebWebviewConfiguration,
   ]
+  if (env.mode === 'development') {
+    config.plugins.push(new ReactRefreshWebpackPlugin())
+  }
   return config
 }