# yyl-rev-webpack-plugin

> yyl rev webpack plugin

Latest version **1.0.11** (published 2021-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install yyl-rev-webpack-plugin
pnpm add yyl-rev-webpack-plugin
yarn add yyl-rev-webpack-plugin
bun add yyl-rev-webpack-plugin
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2021-06-26 |
| First published | 2020-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 36.7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | liudaojie |
| Maintainers | jackness |

## Links

- npm: https://www.npmjs.com/package/yyl-rev-webpack-plugin
- Repository: https://github.com/jackness1208/yyl-rev-webpack-plugin
- Homepage: https://github.com/jackness1208/yyl-rev-webpack-plugin#readme
- Issues: https://github.com/jackness1208/yyl-rev-webpack-plugin/issues
- npm.io page: https://npm.io/package/yyl-rev-webpack-plugin

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [tapable](https://npm.io/package/tapable.md) ^2.2.0
- [@types/webpack](https://npm.io/package/@types/webpack.md) ^5.28.0
- [yyl-webpack-plugin-base](https://npm.io/package/yyl-webpack-plugin-base.md) ^0.2.2

## Recent versions

- 1.0.11 (latest) — 2021-06-26
- 1.0.10 — 2021-05-16
- 1.0.9 — 2021-05-16
- 1.0.8 — 2021-04-13
- 0.1.8 — 2021-03-29
- 1.0.7 — 2021-03-07
- 1.0.6 — 2021-03-06
- 1.0.5 — 2021-03-05
- 1.0.4 — 2021-02-08
- 1.0.3 — 2021-02-04
- 1.0.2 — 2021-02-04
- 1.0.0 — 2021-02-03
- 0.1.7 — 2020-11-24
- 0.1.6 — 2020-11-24
- 0.1.5 — 2020-03-09
- … 5 more at https://npm.io/package/yyl-rev-webpack-plugin/versions

## README

# yyl-rev-webpack-plugin

## USAGE

```javascript
const YylRevWebpackPlugin = require('yyl-rev-webpack-plugin')
const wConfig = {
  plugins: [
    new YylRevWebpackPlugin({
      context: __dirname,
      /** 文件名称 */
      revFilename: '../assets/rev-manifest.json',
      /** rev 输出内容的相对地址 */
      revRoot: '../',
      /** 线上配置地址，用于映射线上配置在本地生成一模一样的文件 */
      remoteAddr: '',
      /** 映射线上配置时如线上对应本地 css 文件为空时，自动在本地生成空白css */
      remoteBlankCss: true,
      /** 是否映射线上配置 */
      remote: false,
      /** 扩展参数, 会追加到 rev json 里面 */
      extends: {}
    })
  ]
}
```

## hooks

```javascript
let YylRevWebpackPlugin
try {
  YylRevWebpackPlugin = require('yyl-rev-webpack-plugin')
} catch (e) {
  if (!(e instanceof Error) || e.code !== 'MODULE_NOT_FOUND') {
    throw e
  }
}

const PLUGIN_NAME = 'your_plugin'
class ExtPlugin {
  apply(compiler) {
    const IPlugin = YylRevWebpackPlugin
    if (IPlugin) {
      compiler.hooks.compilation.tap(IPlugin.getName(), (compilation) => {
        IPlugin.getHooks(compilation).afterRev.tapAsync(PLUGIN_NAME, (obj, done) => {
          console.log('hooks.afterRev(obj, done)', 'obj:', obj)
          done(null, obj)
        })

        IPlugin.getHooks(compilation).emit.tapAsync(PLUGIN_NAME, (obj, done) => {
          console.log('hooks.emit(obj, done)', 'obj:', obj)
          done(null, obj)
        })
      })
    }
  }
}
```

## 文档

[这里](./docs/modules.md)

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