diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -28,7 +28,7 @@ function HtmlReplaceWebpackPlugin(options)
       }
       else
       {
-        htmlData = htmlData.replace(option.pattern, option.replacement)
+        htmlData = htmlData.split(option.pattern).join(option.replacement)
       }
     })
     return htmlData
Support replacing all instances of the string in a html file