Skip to content

Commit 871630a

Browse files
fix: support HtmlWebpackPlugin v4 hooks interface (#14)
1 parent 031247c commit 871630a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// https://github.com/ampedandwired/html-webpack-plugin#events
2424

2525
'use strict'
26+
const HtmlWebpackPlugin = require('html-webpack-plugin')
2627
const escapeStringRegexp = require('escape-string-regexp')
2728

2829
class InterpolateHtmlPlugin {
@@ -32,7 +33,7 @@ class InterpolateHtmlPlugin {
3233

3334
apply(compiler) {
3435
compiler.hooks.compilation.tap('InterpolateHtmlPlugin', compilation => {
35-
compilation.hooks.htmlWebpackPluginBeforeHtmlProcessing.tap(
36+
HtmlWebpackPlugin.getHooks(compilation).afterTemplateExecution.tap(
3637
'InterpolateHtmlPlugin',
3738
data => {
3839
// Run HTML through a series of user-specified string replacements.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
"escape-string-regexp": "^1.0.5"
3434
},
3535
"peerDependencies": {
36-
"html-webpack-plugin": "^3.2.0"
36+
"html-webpack-plugin": ">=4.5.1"
3737
}
3838
}

0 commit comments

Comments
 (0)