# html-tag-replace-webpack-plugin

> A plugin supports inject into tag due to html-webpack-plugin

Latest version **1.0.2** (published 2017-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-tag-replace-webpack-plugin
pnpm add html-tag-replace-webpack-plugin
yarn add html-tag-replace-webpack-plugin
bun add html-tag-replace-webpack-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.2 |
| Published | 2017-03-02 |
| First published | 2017-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Chersquwn |
| Maintainers | chersquwn |
| Keywords | webpack, plugin, tag, replace, html |

## Links

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

## Dependencies (5)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.7
- [toposort](https://npm.io/package/toposort.md) ^1.0.2
- [loader-utils](https://npm.io/package/loader-utils.md) ^0.2.16
- [pretty-error](https://npm.io/package/pretty-error.md) ^2.0.2

## 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.2 (latest) — 2017-03-02
- 1.0.1 — 2017-03-02
- 1.0.0 — 2017-02-08

## README

# html-tag-replace-webpack-plugin

è¿æ¯ä¸ä¸ªå¨html-webpack-pluginåºç¡ä¸ä¿®æ¹çæä»¶ï¼å¨åæ¥çæä»¶çåºç¡ä¸ï¼æ·»å äºcssåjsèµæºèªå®ä¹æ³¨å¥ä½ç½®çåè½ã

## å®è£

```
npm install html-tag-replace-webpack-plugin
```

## ä½¿ç¨
htmlæ¨¡æ¿
```
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="keywords" content="" />
    <meta http-equiv="description" content="" />
    <title>html-replace-webpack-plugin demo</title>

    <!-- inject:css -->
    <!-- endinject -->
  </head>
  <body>

    <!-- inject:js -->
    <!-- endinject -->
  </body>
</html>
```
webpack.config.js
```
var HtmlTagReplaceWebpackPlugin = require('html-tag-replace-webpack-plugin')

module.exports = {
  ...
  plugins: [
    new HtmlTagReplaceWebpackPlugin({
      inject: true,
      injectPoint: {
          css: ['<!-- inject:css -->', '<!-- endinject -->'],
          js: ['<!-- inject:js -->', '<!-- endinject -->']
      },
    })
  ]
  ...
}
```

webpackç¼è¯çæçhtml
```
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="keywords" content="" />
    <meta http-equiv="description" content="" />
    <title>html-replace-webpack-plugin demo</title>

    <!-- inject:css -->
    <link href="/static/css/index.css" rel="stylesheet">
    <!-- endinject -->
  </head>
  <body>

    <!-- inject:js -->
    <script type="text/javascript" src="/static/js/common.js"></script>
    <script type="text/javascript" src="/static/js/index.js"></script>
    <!-- endinject -->
  </body>
</html>
```

## API
å¶ä»APIä¸html-webpack-pluginç¸åã
### æ°å¢çAPIï¼
- injectPointï¼
  - Type: `Array`
  - Value: `[startTag, endTag]`
  - optionalï¼å¦æä¸è®¾ç½®æ­¤åæ°ï¼å°ä¸html-webpack-pluginåè½ç¸å

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