# html-webpack-local-cache-plugin

> 使用localstorage缓存js和css资源，需要配合HtmlWebpackPlugin使用

Latest version **1.0.1** (published 2017-09-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install html-webpack-local-cache-plugin
pnpm add html-webpack-local-cache-plugin
yarn add html-webpack-local-cache-plugin
bun add html-webpack-local-cache-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.1 |
| Published | 2017-09-21 |
| First published | 2017-09-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zesonliu |
| Maintainers | zesonliu |

## Links

- npm: https://www.npmjs.com/package/html-webpack-local-cache-plugin
- npm.io page: https://npm.io/package/html-webpack-local-cache-plugin

## Recent versions

- 1.0.1 (latest) — 2017-09-21
- 1.0.0 — 2017-09-19

## README

使用localstorage缓存js和css资源，需要配合HtmlWebpackPlugin使用。

# 使用方法

```
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackLocalCachePlugin = require('html-webpack-local-cache-plugin');
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'index_bundle.js'
  },
  plugins: [
    new HtmlWebpackPlugin(),
    new HtmlWebpackLocalCachePlugin({
      cacheSource: '(app\..*\.js|vendor\..*\.js)$', // 通过正则校验需要缓存的文件
      cacheEnsure: false, // 是否连ensure异步加载的js也缓存，默认false
      cssSync: true, // 是否使用document.write的方式加载，false则用xhr加载css，默认是false
      jsSync: true // 是否使用document.write的方式加载，false则用xhr加载js，默认是false
    })
  ]
};
```

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