Merge pull request #57 from relayfoods/master
Fix existing manifest regex test
This commit is contained in:
commit
43aa8a3984
4
index.js
4
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(/(<html.*)(>)/i, function (match, start, end) {
|
||||
html = html.replace(/(<html[^>]*)(>)/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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue