diff --git a/package-lock.json b/package-lock.json index bf4c71e..a3bd531 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "webpack-font-preload-plugin", - "version": "1.1.0", + "version": "1.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 29d53dc..3e0a3ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack-font-preload-plugin", - "version": "1.1.0", + "version": "1.2.0", "description": "A webpack plugin to allow preloading or prefetching of fonts.", "main": "src/cjs.js", "scripts": { @@ -23,7 +23,8 @@ "prefetch" ], "peerDependencies": { - "webpack": "^4.0.0 || ^5.0.0" + "webpack": "^4.0.0 || ^5.0.0", + "jsdom": "^16.0.0" }, "author": "Satyendra Singh Naruka", "license": "MIT", diff --git a/src/index.js b/src/index.js index 5e35447..4a1409c 100644 --- a/src/index.js +++ b/src/index.js @@ -104,9 +104,9 @@ class WebpackFontPreloadPlugin { head.innerHTML = `${links}${head.innerHTML.trim()}`; } else { const parent = insertBeforeTag.parentNode; - const newNodes = this.createNodeFromHtml(document, links); + const newNodes = Array.from(this.createNodeFromHtml(document, links)); if (newNodes && newNodes.length > 0) { - Array.from(newNodes).forEach((n) => { + newNodes.forEach((n) => { parent.insertBefore(n, insertBeforeTag); }); }