fix: remove <noscript> when static content is generated and rendered already

This commit is contained in:
Danny Koppenhagen
2023-06-19 14:11:57 +02:00
committed by Stefan Rotsch
parent 3dcb9075b7
commit 8876d3b1c7
4 changed files with 14 additions and 3 deletions

View File

@@ -95,6 +95,11 @@ var createStaticFiles = function () { return __awaiter(void 0, void 0, void 0, f
headlineNode.appendChild(titleText);
rootEl.appendChild(headlineNode);
rootEl.appendChild(textNode);
// remove the <noscript> element as page has already been hydrated with static content
var noscriptEl = document.getElementsByTagName("noscript");
if (noscriptEl[0]) {
noscriptEl[0].remove();
}
}
else {
console.warn('Element with ID "root" not found. Static site content will be empty.');