fix: webpack hot reloading

zio/stable
Michael Staub 2023-02-23 16:32:56 -08:00
parent e11f360376
commit c173cffd62
1 changed files with 21 additions and 0 deletions

View File

@ -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',