Skip to content

Commit

Permalink
Remove unneeded errors
Browse files Browse the repository at this point in the history
The if statements are testing whether these particular library files have already been added to the list of scripts/styles that will be included on the page, so that multiple link/script tags aren't created for the same files.

If the files have already been added by previously calling the attach function, that is entirely fine, and not an issue.
  • Loading branch information
mikemccaffrey authored and RobLoach committed Jun 22, 2024
1 parent 37c4109 commit 90d9450
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/kalastatic.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ function addTwigAttachLibrary(renderData, config) {
renderData.stylesheet_files.push(filename);
renderData.kalastatic_stylesheets[0] += "<link href=\"" + renderData.base_url + "/" + filename + "\" rel=\"stylesheet\">";
}
else {
console.error(`kalastatic: Library stylesheet file missing: ${library} ${source} expects "${filename}"`);
}
}

// Add any associated scripts
Expand All @@ -205,9 +202,6 @@ function addTwigAttachLibrary(renderData, config) {
renderData.script_files.push(filename);
renderData.kalastatic_scripts[0] += "<script src=\"" + renderData.base_url + "/" + filename + "\" ></script>";
}
else {
console.error(`kalastatic: Library JavaScript file missing: ${library} ${source} expects "${filename}"`);
}
}
};

Expand Down

0 comments on commit 90d9450

Please sign in to comment.