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

Function initPreloader

packages/qwik/src/core/preloader/bundle-graph.ts:121–141  ·  view source on GitHub ↗
(
  serializedBundleGraph?: (string | number)[],
  opts?: {
    debug?: boolean;
    preloadProbability?: number;
  }
)

Source from the content-addressed store, hash-verified

119
120/** Used during SSR */
121export const initPreloader = (
122 serializedBundleGraph?: (string | number)[],
123 opts?: {
124 debug?: boolean;
125 preloadProbability?: number;
126 }
127) => {
128 if (opts) {
129 if ('debug' in opts) {
130 config.$DEBUG$ = !!opts.debug;
131 }
132 if (typeof opts.preloadProbability === 'number') {
133 config.$invPreloadProbability$ = 1 - opts.preloadProbability;
134 }
135 }
136 if (base != null || !serializedBundleGraph) {
137 return;
138 }
139 base = '';
140 graph = parseBundleGraph(serializedBundleGraph);
141};

Callers 1

preloaderPreFunction · 0.90

Calls 1

parseBundleGraphFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…