diff --git a/index.js b/index.js index b181f6b..8b23c22 100644 --- a/index.js +++ b/index.js @@ -300,9 +300,9 @@ HtmlWebpackPlugin.prototype.injectAssetsIntoHtml = function(html, templateParams }); // Inject manifest into the opening html tag if (assets.manifest) { - html = html.replace(/()/i, function (match, start, end) { + html = html.replace(/(]*)(>)/i, function (match, start, end) { // Append the manifest only if no manifest was specified - if (match.test(/\smanifest\s*=/)) { + if (/\smanifest\s*=/.test(match)) { return match; } return start + ' manifest="' + assets.manifest + '"' + end;