MCPcopy
hub / github.com/QwikDev/qwik / preloaderPost

Function preloaderPost

packages/qwik/src/server/preload-impl.ts:206–230  ·  view source on GitHub ↗
(
  base: string,
  snapshotResult: SnapshotResult,
  opts: RenderToStreamOptions,
  resolvedManifest: ResolvedManifest | undefined,
  output: (JSXNode | null)[]
)

Source from the content-addressed store, hash-verified

204};
205
206export const preloaderPost = (
207 base: string,
208 snapshotResult: SnapshotResult,
209 opts: RenderToStreamOptions,
210 resolvedManifest: ResolvedManifest | undefined,
211 output: (JSXNode | null)[]
212) => {
213 if (opts.preloader !== false) {
214 // skip prefetch implementation if prefetchStrategy === null
215 const preloadBundles = getPreloadPaths(snapshotResult, opts, resolvedManifest);
216 // If no preloadBundles, there is no reactivity, so no need to include the preloader
217 if (preloadBundles.length > 0) {
218 const result = includePreloader(
219 base,
220 resolvedManifest,
221 opts.preloader,
222 preloadBundles,
223 opts.serverData?.nonce
224 );
225 if (result) {
226 output.push(result);
227 }
228 }
229 }
230};
231
232function normalizePreLoaderOptions(
233 input: PreloaderOptions | undefined

Callers 1

renderToStreamFunction · 0.90

Calls 2

getPreloadPathsFunction · 0.90
includePreloaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…