Webpack plugin for retrying async chunk loading.
__webpack__require__.e /* nsure */ function call on promise rejections.
Compatible with Webpack 4 and 5.
const RetryEnsureWebpackPlugin = require('retry-ensure-webpack-plugin').RetryEnsureWebpackPlugin; /* ... */ plugins.push(new RetryEnsureWebpackPlugin(options));
An optional parameter, object with properties.
The max amount of retries. After that, Promise rejection is not handled by this plugin.
Note: This option is "max retries", not "max requests". In the worst case there would be
1 + max requests total.
0, this plugin is turned off entirely.
Infinity is a valid value, if you want to retry until the end of time.
number | string)
number: Amount of milliseconds between retries, constant value.
string: Expression that returns a numeric value. A variable
retriedTimescan be used for exponential (or whatever you like) backoff.
0at the first retry attempt.
Note that this expression is not validated in any way. It's just plugged into your generated code.
'retriedTimes * retriedTimes * 1000'