From 82ef236cb1a3ce2c7fb268fa03d86c4e098193a3 Mon Sep 17 00:00:00 2001 From: Chip Lay Date: Wed, 10 Jun 2015 09:27:38 -0400 Subject: [PATCH 1/2] Fix existing manifest regex test --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b181f6b..e43d95c 100644 --- a/index.js +++ b/index.js @@ -302,7 +302,7 @@ HtmlWebpackPlugin.prototype.injectAssetsIntoHtml = function(html, templateParams if (assets.manifest) { 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; From f5842d609e172375a304c95e97be01e278361202 Mon Sep 17 00:00:00 2001 From: Chip Lay Date: Wed, 10 Jun 2015 10:06:43 -0400 Subject: [PATCH 2/2] Better regex for minified html strings --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e43d95c..8b23c22 100644 --- a/index.js +++ b/index.js @@ -300,7 +300,7 @@ 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 (/\smanifest\s*=/.test(match)) { return match;