# html-webpack-replace-assets-plugin

> change assets path when html-webpack-plugin generate assets

Latest version **1.0.6** (published 2020-05-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install html-webpack-replace-assets-plugin
pnpm add html-webpack-replace-assets-plugin
yarn add html-webpack-replace-assets-plugin
bun add html-webpack-replace-assets-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.6 |
| Published | 2020-05-06 |
| First published | 2020-05-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.0 |
| Dependencies | 1 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | maoquan |
| Maintainers | maoquan |

## Links

- npm: https://www.npmjs.com/package/html-webpack-replace-assets-plugin
- Repository: https://github.com/3610cn/webpack-concat-plugin
- Issues: https://github.com/3610cn/webpack-concat-plugin/issues
- npm.io page: https://npm.io/package/html-webpack-replace-assets-plugin

## Dependencies (1)

- [schema-utils](https://npm.io/package/schema-utils.md) ^0.4.5

## Recent versions

- 1.0.6 (latest) — 2020-05-06
- 1.0.5 — 2020-05-06
- 1.0.4 — 2020-05-06
- 1.0.3 — 2020-05-06
- 1.0.2 — 2020-05-06
- 1.0.1 — 2020-05-06
- 1.0.0 — 2020-05-06

## README

# html-webpack-replace-assets-plugin

[![Build Status](https://img.shields.io/travis/maoquan/html-webpack-replace-assets-plugin.svg)](https://travis-ci.org/maoquan/html-webpack-replace-assets-plugin)
[![npm package](https://img.shields.io/npm/v/html-webpack-replace-assets-plugin.svg)](https://www.npmjs.org/package/html-webpack-replace-assets-plugin)
[![npm downloads](http://img.shields.io/npm/dm/html-webpack-replace-assets-plugin.svg)](https://www.npmjs.org/package/html-webpack-replace-assets-plugin)

> A plugin to help webpack concat js and inject into html

### Why

Webpack is really powerful. However, when I want to change the asset files and inject into html without webpack JSONP code wrapper, it seems impossible to do that without other tool's help.

### Install

```
npm install html-webpack-replace-assets-plugin --save-dev
```

### Features

- replace assets path when inject to html(with html-webpack-plugin)

### Usage

```javascript
const HtmlWebpackReplaceAssetsPlugin = require('html-webpack-replace-assets-plugin');

new HtmlWebpackReplaceAssetsPlugin({
  ...see options
  // examples
  convert(asset, path) {
    // asset: webpack asset object
    // path: asset path
    return path.replace('.js', `${asset.size()}.js.gz`);
  }
});

```

### Options

#### convert [Function] default: (asset, path) => name

assets path(or name) transformer

### TODO

- [ ] add css support

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