From fb448dd6b6e09613af1ec974925e1bcf714bcbce Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Tue, 11 Sep 2018 10:25:06 +0200 Subject: [PATCH] docs(readme): Add example how to use as peer dependency --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 10c08040..9a518907 100644 --- a/README.md +++ b/README.md @@ -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) => {