MCPcopy
hub / github.com/vitejs/vite / createModernChunkLegacyGuard

Function createModernChunkLegacyGuard

packages/plugin-legacy/src/snippets.ts:29–30  ·  view source on GitHub ↗
(chunkId: string)

Source from the content-addressed store, hash-verified

27export const dynamicFallbackInlineCode: string = `!function(){if(window.${detectModernBrowserVarName})return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("${legacyPolyfillId}"),n=document.createElement("script");n.src=e.src,n.onload=function(){${systemJSInlineCode}},document.body.appendChild(n)}();`
28
29export const createModernChunkLegacyGuard = (chunkId: string): string =>
30 `import'${createDetectImportMetaResolveSupportModule(chunkId)}';export function __vite_legacy_guard(){${detectModernBrowserDetector}};`

Callers 2

renderChunkFunction · 0.90
snippets.spec.tsFile · 0.90

Tested by

no test coverage detected