# import-retry-plugin

> dynamic import script with webpack4 ，when loading chunk error，retry it and break cdn ticks

Latest version **1.0.4** (published 2019-02-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install import-retry-plugin
pnpm add import-retry-plugin
yarn add import-retry-plugin
bun add import-retry-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-02-26 |
| First published | 2019-02-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | happybang |

## Links

- npm: https://www.npmjs.com/package/import-retry-plugin
- Repository: https://github.com/SinaMFE/import-retry-plugin
- Homepage: https://github.com/SinaMFE/import-retry-plugin#readme
- Issues: https://github.com/SinaMFE/import-retry-plugin/issues
- npm.io page: https://npm.io/package/import-retry-plugin

## Recent versions

- 1.0.4 (latest) — 2019-02-26
- 1.0.3 — 2019-02-20
- 1.0.2 — 2019-02-20

## README

<h2 align="center">Scope</h2>

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

<h2 align="center">routeMap</h2>

1. report error
2. use SRI


<h2 align="center">Install</h2>

```bash
npm i import-retry-plugin --save
```

<h2 align="center"><a href="#">Usage</a></h2>

**webpack.config.js**

```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){

}
```

---
_Source: https://npm.io/package/import-retry-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
