New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sreedhar7/webpack-retry-chunk-load-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sreedhar7/webpack-retry-chunk-load-plugin

A webpack plugin to retry loading of chunks that failed to load

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

webpack-retry-chunk-load-plugin

Build Status codecov npm version GitHub issues GitHub stars GitHub license

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

screenshot 2018-10-24 at 21 47 39

Usage

// webpack.config.js
const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');

plugins: [
  new RetryChunkLoadPlugin({
    // optional stringified function to get the cache busting query string appended to the script src
    // if not set will default to appending the string `?cache-bust=true`
    cacheBust: `function() {
      return Date.now();
    }`,
    // optional function called just before retry with errorType, chunkId, url as params
    preRetryCallback: `function(errorType, chunkId, url) {}`,
    // callback used to enable/disable the retry based on error type. 
    // Can also be used for feature rollout via feature flags.
    shouldRetry: `function(errorType) { return true; }`,
    // callback used to enable/disable the cache busting during retry based on error type.
    shouldCacheBust: `function(errorType) { return true; }`,
    // optional value to set the maximum number of retries to load the chunk. Default is 1
    maxRetries: 5,
    // optional list of chunks to which retry script should be injected
    // if not set will add retry script to all chunks that have webpack script loading
    chunks: ['chunkName']
  })
];

angular cli

To use this with the angular CLI you can use the fantastic angular-builders project to extend the built in webpack config

License

MIT

Keywords

FAQs

Package last updated on 26 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc