Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 Repros version #239

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
remove dev preloader script
thejackshelton committed Mar 21, 2025
commit 8ee963838d93b0e3165876aebeaddb500a3473cd
26 changes: 0 additions & 26 deletions libs/qwikdev-astro/server.ts
Original file line number Diff line number Diff line change
@@ -182,32 +182,6 @@ export async function renderToStaticMarkup(

await renderToStream(qwikComponentJSX as JSXOutput, renderToStreamOpts);

// we only want to add the preloader script if the container is the last one
if (isDev && devUrls.size > 0) {
const preloaderScript = `<script q-astro-dev-preloader>
window.addEventListener("load",()=>{
const symbols = ${JSON.stringify(Array.from(devUrls))};
symbols.forEach(symbol => {
const link = document.createElement('link');
link.rel = 'modulepreload';
link.href = symbol;
link.fetchPriority = 'low';
document.head.appendChild(link);
});
});
</script>`;

// if there is one container, add the preloader script to the first one
if (html.includes('q-astro-marker="first"')) {
html += preloaderScript;
}

// if there is more than one container, add the preloader script to the last one
if (html.includes('q-astro-marker="last"')) {
html += preloaderScript;
}
}

const isClientRouter = Array.from(this.result._metadata.renderedScripts).some(
(path) => path.includes("ClientRouter.astro")
);