# yyl-sugar-webpack-plugin

> yyl sugar webpack plugin

Latest version **1.0.10** (published 2021-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install yyl-sugar-webpack-plugin
pnpm add yyl-sugar-webpack-plugin
yarn add yyl-sugar-webpack-plugin
bun add yyl-sugar-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.10 |
| Published | 2021-06-25 |
| First published | 2020-02-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 37.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jackness1208 |
| Maintainers | jackness |

## Links

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

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [tapable](https://npm.io/package/tapable.md) ^2.2.0
- [yyl-util](https://npm.io/package/yyl-util.md) ^2.3.9
- [yyl-file-replacer](https://npm.io/package/yyl-file-replacer.md) ^0.6.4
- [yyl-webpack-plugin-base](https://npm.io/package/yyl-webpack-plugin-base.md) ^0.2.2

## Recent versions

- 1.0.10 (latest) — 2021-06-25
- 1.0.9 — 2021-04-13
- 1.0.8 — 2021-04-13
- 1.0.7 — 2021-04-04
- 1.0.6 — 2021-03-09
- 1.0.5 — 2021-03-06
- 1.0.4 — 2021-03-06
- 1.0.3 — 2021-02-04
- 1.0.2 — 2021-02-03
- 1.0.1 — 2021-02-03
- 1.0.0 — 2021-02-03
- 0.1.14 — 2020-05-14
- 0.1.13 — 2020-03-10
- 0.1.12 — 2020-03-10
- 0.1.11 — 2020-03-09
- … 10 more at https://npm.io/package/yyl-sugar-webpack-plugin/versions

## README

# yyl-sugar-webpack-plugin

## USAGE

```javascript
const YylSugarWebpackPlugin = require('yyl-sugar-webpack-plugin')
const wConfig = {
  plugins: [new YylSugarWebpackPlugin({ basePath: __dirname })]
}
```

## hooks

```javascript
let YylSugarWebpackPlugin
try {
  YylSugarWebpackPlugin = require('yyl-sugar-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 = YylSugarWebpackPlugin
    if (IPlugin) {
      compiler.hooks.compilation.tap(IPlugin.getName(), (compilation) => {
        IPlugin.getHooks(compilation).beforeSugar.tapAsync(PLUGIN_NAME, (obj, done) => {
          console.log('hooks.beforeSugar(obj, done)', 'obj:', obj)
          done(null, obj)
        })
        IPlugin.getHooks(compilation).afterSugar.tapAsync(PLUGIN_NAME, (obj, done) => {
          console.log('hooks.afterSugar(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-sugar-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
