import-retry-plugin

1.0.4 • Public • Published

Scope

  1. cdn hijacking occasionally; sometimes request with random params (like "react.js?v=12345) is usefull;
  2. the plugin is in case of webpack4 and is work only with chunked script

routeMap

  1. report error
  2. use SRI

Install

npm i import-retry-plugin --save

Usage

webpack.config.js

const ImportRetryPlugin =require("import-retry-plugin");
module.exports = {
  plugins:[new ImportRetryPlugin()]
}

js runtime

// the script must excute before import the chunk file
// src:the script's src
// time:1 (first error)
// time:2 (request src with random params and error again)
window.onChunkError=function(src,time){

}

/import-retry-plugin/

    Package Sidebar

    Install

    npm i import-retry-plugin

    Weekly Downloads

    3

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    17.5 kB

    Total Files

    15

    Last publish

    Collaborators

    • happybang