Skip to content

Commit

Permalink
Merge pull request #16 from sn-satyendra/jsdom-peerdep
Browse files Browse the repository at this point in the history
jsdom should be a peer dependency
  • Loading branch information
sn-satyendra authored Mar 20, 2021
2 parents 66a8a0b + 6eaaea2 commit c951757
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down

0 comments on commit c951757

Please sign in to comment.