我有一个与Webpack捆绑的应用程序 .

有一个主捆绑文件,其余代码分为每个屏幕块 . 主包和块都是使用散列生成的,作为文件名的一部分 .

...
filename: '[name]-[hash].js',
chunkFilename: '[id].[name]-[hash].js'
...

在将新的更改部署到 生产环境 之后,将替换bundle和chunk文件(因此,将删除旧文件) .

如果用户打开了应用程序并尝试导航到应该加载过时块的页面,则部分应用程序崩溃 .

问题: Is there a way to detect failure to load a chunk and auto reload the screen or present an appropriate message?

什么样的策略是可取的?

谢谢 .