# inline-script-plugin

> 加强 `html-webpack-plugin `插件

Latest version **0.0.7** (published 2020-09-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install inline-script-plugin
pnpm add inline-script-plugin
yarn add inline-script-plugin
bun add inline-script-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-09-22 |
| First published | 2020-09-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | zhangcai93 |

## Links

- npm: https://www.npmjs.com/package/inline-script-plugin
- Repository: https://github.com/zhangcai93/inline-script-plugin
- Homepage: https://github.com/zhangcai93/inline-script-plugin#readme
- Issues: https://github.com/zhangcai93/inline-script-plugin/issues
- npm.io page: https://npm.io/package/inline-script-plugin

## Recent versions

- 0.0.7 (latest) — 2020-09-22
- 0.0.6 — 2020-09-21
- 0.0.5 — 2020-09-20
- 0.0.4 — 2020-09-17
- 0.0.3 — 2020-09-17
- 0.0.2 — 2020-09-16

## README

## inline-script-plugin

加强 `html-webpack-plugin `插件

将给定路径的script插入到所有js脚本的最前面, 或直接插入到head标签中

提供以inline的形式插入到html中

使用前确保有安装 `html-webpack-plugin `

### 安装

```javascript
npm i inline-script-plugin -D
```

### 使用

将`inline-script-plugin`添加到`webpack`插件配置当中：

```javascript
// vue.config.js为例
const InlineScriptPlugin = require('inline-script-plugin')

module.exports = {
  xxx,
  chainWebpack: config => {
    config
      .plugin('InlineScriptPlugin')
      .after('html')
      .use(InlineScriptPlugin, [
        {
          name: 'abc', // yourName
          path: './a/b.js', // yourPath
          inhead: true,
          inline: true
        }
      ])
      .end()
  }
}
```

有关 options 配置如下：

|字段名|参数类型|默认值|是否必填|说明|
|--|--|--|--|--|
| name | String | - | 是 | 文件名 | 
| path | String | - | 是 | 文件路径 |
| inline | Boolean | false | 否 | 是否以inline形式插入脚本 |
| inhead | Boolean | false | 否 | 是否将脚本插入到head标签里 |

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