Skip to content

Commit

Permalink
docs(readme): Add example how to use as peer dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Sep 11, 2018
1 parent 99f9362 commit fb448dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -371,6 +371,11 @@ Example implementation: [html-webpack-harddisk-plugin](https://github.com/jantim

**plugin.js**
```js
// If your plugin is direct dependent to the html webpack plugin:
const HtmlWebpackPlugin = require('html-webpack-plugin');
// If your plugins is using html-webpack-plugin you can use https://github.com/tallesl/node-safe-require
const HtmlWebpackPlugin = require('safe-require')('html-webpack-plugin');

class MyPlugin {
apply (compiler) {
compiler.hooks.compilation.tap('MyPlugin', (compilation) => {
Expand Down

0 comments on commit fb448dd

Please sign in to comment.