# html-webpack-plugin-inner

> fork from html-webpack-plugin, 插入innerhtml数据

Latest version **1.0.3** (published 2019-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-webpack-plugin-inner
pnpm add html-webpack-plugin-inner
yarn add html-webpack-plugin-inner
bun add html-webpack-plugin-inner
```

## 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.3 |
| Published | 2019-03-05 |
| First published | 2018-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 35.1 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Alan |
| Maintainers | izi |
| Keywords | webpack, plugin, html, html-webpack-plugin-inner |

## Links

- npm: https://www.npmjs.com/package/html-webpack-plugin-inner
- Repository: https://github.com/zlus/html-webpack-plugin-inner
- Homepage: https://github.com/zlus/html-webpack-plugin-inner#readme
- Issues: https://github.com/zlus/html-webpack-plugin-inner/issues
- npm.io page: https://npm.io/package/html-webpack-plugin-inner

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^4.17.3
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.7
- [toposort](https://npm.io/package/toposort.md) ^1.0.0
- [loader-utils](https://npm.io/package/loader-utils.md) ^0.2.16
- [pretty-error](https://npm.io/package/pretty-error.md) ^2.0.2
- [html-minifier](https://npm.io/package/html-minifier.md) ^3.2.3

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-03-05
- 1.0.2 — 2018-08-21
- 1.0.1 — 2018-05-03
- 1.0.0 — 2018-05-03

## README

### fork from html-webpack-plugin, 插入innerhtml数据
## 打包后不直接把资源路径插入html，而是生成window.buildAssets，方便手动控制加载资源
## config 基本和 html-webpack-plugin一样
```
const HtmlWebpackPlugin = require('html-webpack-plugin-inner')

new HtmlWebpackPlugin({
    filename: '../index.html',
    template: 'index.html',
    inject: true,
    assetsKey:'buildAssets' //默认
}),
```
## 打包后的代码
```
  <script>
    window.buildAssets = [{
        tagName: 'link',
        selfClosingTag: false,
        hash: 'e9dabf34b89953a3e8c7',
        attributes: {
          href: '/team/client/static/css/app.css',
          rel: 'stylesheet',
        },
        position: 'head',
      },
      {
        tagName: 'script',
        hash: 'e9dabf34b89953a3e8c7',
        attributes: {
          type: 'text/javascript',
          src: '/team/client/static/js/app.js',
        },
        position: 'body',
      },
    ]
  </script>
```

## 其他

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