我正在使用电子,我有一个弹出的创建反应应用程序 webpack 配置。我启用了热模块更换。
生成了热更新,在终端中我看到例如5f4dde8b4941bfe36ef8.hot-update.json,但客户端似乎找不到这些更新
知道如何调试或解决此问题吗?
我怀疑客户试图查找更新的路径是错误的。
在客户端控制台中,我可以看到:
[HMR] Waiting for update signal from WDS...
[WDS] Hot Module Replacement enabled.
[WDS] App updated. Recompiling...
[WDS] App hot update...
[HMR] Checking for updates on the server...
[HMR] Cannot find update. Need to do a full reload!
[HMR] (Probably because of restarting the webpack-dev-server)
webpack配置摘录:
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080',
require.resolve('webpack/hot/only-dev-server'),
require.resolve('react-hot-loader/patch'),
require.resolve('./polyfills'),
require.resolve('react-error-overlay'),
paths.appIndexJs,
],
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/bundle.js',
chunkFilename: 'static/js/[name].chunk.js',
publicPath: '/',
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
},
webpack 开发服务器配置的摘录:
contentBase: paths.appPublic,
hot: true,
publicPath: config.output.publicPath,