Skip to content

Commit

Permalink
manage: Migrated to html-webpack-plugin 4
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <jaid.jsx@gmail.com>
  • Loading branch information
Jaid committed Mar 27, 2020
1 parent d7b0cf7 commit a9040ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @module inject-body-webpack-plugin */

import HtmlWebpackPlugin from "html-webpack-plugin"
import insertStringAfter from "insert-string-after"
import insertStringBefore from "insert-string-before"

Expand Down Expand Up @@ -33,7 +34,7 @@ export default class InjectBrowserSyncPlugin {
*/
apply(compiler) {
compiler.hooks.compilation.tap(_PKG_NAME, compilation => {
compilation.hooks.htmlWebpackPluginAfterHtmlProcessing.tapAsync(_PKG_NAME, (data, cb) => {
HtmlWebpackPlugin.getHooks(compilation).beforeEmit.tapAsync(_PKG_NAME, (data, cb) => {
if (this.options.position === "end") {
data.html = insertStringBefore(data.html, "</body>", this.options.content)
} else {
Expand Down

0 comments on commit a9040ed

Please sign in to comment.