Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.48 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.48 KB

rspack-plugin-retry-chunk-load

npm version GitHub issues GitHub stars GitHub license

A rspack plugin to retry loading of async chunks that failed to load

Inspired by webpack-retry-load-plugin

Usage

// rspack.config.js
import { RetryChunkLoadPlugin } from "rspack-plugin-retry-chunk-load";

plugins: [
  new RetryChunkLoadPlugin({
    /**
     * Optional identifier for the cache-busting function. Can be 'default' (`?cache-bust=true`) or 'timestamp' (Date.now()).
     */
    cacheBust: "timestamp";
    /**
     * Optional value to set the maximum number of retries to load the chunk.
     * Default is 3.
     */
    maxRetries: 3;
    /**
     * Optional value to set the amount of time in milliseconds before trying to load the chunk again.
     * Default is 100ms.
     */
    retryDelay: 100;
  })
];

License

MIT