Home / File/ snippets.ts — vite Source File

snippets.ts — vite Source File

Architecture documentation for snippets.ts, a typescript file in the vite codebase. 0 imports, 2 dependents.

Entity Profile

Dependency Diagram

graph LR
  ce349c09_3cd5_548b_1a03_c4108351206c["snippets.ts"]
  91faf3c1_99a4_1091_6836_b828c5b773b5["snippets.spec.ts"]
  91faf3c1_99a4_1091_6836_b828c5b773b5 --> ce349c09_3cd5_548b_1a03_c4108351206c
  9776ecb6_00c0_b3b9_b3f7_177fedabeacc["index.ts"]
  9776ecb6_00c0_b3b9_b3f7_177fedabeacc --> ce349c09_3cd5_548b_1a03_c4108351206c
  style ce349c09_3cd5_548b_1a03_c4108351206c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// https://gist.github.com/samthor/64b114e4a4f539915a95b91ffd340acc
// DO NOT ALTER THIS CONTENT
export const safari10NoModuleFix: string = `!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();`

export const legacyPolyfillId: string = 'vite-legacy-polyfill'
export const legacyEntryId: string = 'vite-legacy-entry'
export const systemJSInlineCode: string = `System.import(document.getElementById('${legacyEntryId}').getAttribute('data-src'))`

const detectModernBrowserVarName = '__vite_is_modern_browser'
export const detectModernBrowserDetector: string = `import.meta.url;import("_").catch(()=>1);(async function*(){})().next()`
export const detectModernBrowserCode: string = `${detectModernBrowserDetector};window.${detectModernBrowserVarName}=true`
export 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)}();`

export const modernChunkLegacyGuard: string = `export function __vite_legacy_guard(){${detectModernBrowserDetector}};`

Domain

Frequently Asked Questions

What does snippets.ts do?
snippets.ts is a source file in the vite codebase, written in typescript. It belongs to the PluginSystem domain.
What files import snippets.ts?
snippets.ts is imported by 2 file(s): index.ts, snippets.spec.ts.
Where is snippets.ts in the architecture?
snippets.ts is located at packages/plugin-legacy/src/snippets.ts (domain: PluginSystem, directory: packages/plugin-legacy/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free