Skip to content

Commit 396e7ff

Browse files
authored
Merge pull request #39 from slackhq/an-ensure-html-webpack-plugin-hooks-present
Ensuring that html webpack plugin hooks are available
2 parents 14aabb3 + ecd269c commit 396e7ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ class CspHtmlWebpackPlugin {
357357
'CspHtmlWebpackPlugin',
358358
this.processCsp.bind(this)
359359
);
360-
} else {
360+
} else if (
361+
compilation.hooks.htmlWebpackPluginBeforeHtmlGeneration &&
362+
compilation.hooks.htmlWebpackPluginAfterHtmlProcessing
363+
) {
361364
// HTMLWebpackPlugin@3
362365
compilation.hooks.htmlWebpackPluginBeforeHtmlGeneration.tapAsync(
363366
'CspHtmlWebpackPlugin',

0 commit comments

Comments
 (0)