@@ -72,7 +72,6 @@ export async function renderToStaticMarkup(
7272 }
7373
7474 let html = "" ;
75- const devUrls = new Set < string > ( ) ;
7675
7776 const renderToStreamOpts : RenderToStreamOptions = {
7877 containerAttributes : {
@@ -83,17 +82,7 @@ export async function renderToStaticMarkup(
8382 ...( isDev
8483 ? {
8584 manifest : { } as QwikManifest ,
86- symbolMapper : ( symbolName , mapper , parent ) => {
87- const requestUrl = new URL ( this . result . request . url ) ;
88- const origin = requestUrl . origin ;
89- const devUrl = origin + parent + "_" + symbolName + ".js" ;
90- devUrls . add ( devUrl ) ;
91-
92- // this determines if the container is the last one
93- renderToStreamOpts . containerAttributes ! [ "q-astro-marker" ] = "last" ;
94-
95- return globalThis . symbolMapperFn ( symbolName , mapper , parent ) ;
96- }
85+ symbolMapper : globalThis . symbolMapperFn
9786 }
9887 : {
9988 manifest : globalThis . qManifest
@@ -182,32 +171,6 @@ export async function renderToStaticMarkup(
182171
183172 await renderToStream ( qwikComponentJSX , renderToStreamOpts ) ;
184173
185- // we only want to add the preloader script if the container is the last one
186- if ( isDev && devUrls . size > 0 ) {
187- const preloaderScript = `<script q-astro-dev-preloader>
188- window.addEventListener("load",()=>{
189- const symbols = ${ JSON . stringify ( Array . from ( devUrls ) ) } ;
190- symbols.forEach(symbol => {
191- const link = document.createElement('link');
192- link.rel = 'modulepreload';
193- link.href = symbol;
194- link.fetchPriority = 'low';
195- document.head.appendChild(link);
196- });
197- });
198- </script>` ;
199-
200- // if there is one container, add the preloader script to the first one
201- if ( html . includes ( 'q-astro-marker="first"' ) ) {
202- html += preloaderScript ;
203- }
204-
205- // if there is more than one container, add the preloader script to the last one
206- if ( html . includes ( 'q-astro-marker="last"' ) ) {
207- html += preloaderScript ;
208- }
209- }
210-
211174 const isClientRouter = Array . from ( this . result . _metadata . renderedScripts ) . some (
212175 ( path ) => path . includes ( "ClientRouter.astro" )
213176 ) ;
0 commit comments