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

Function getHmrImplementation

packages/vite/src/node/plugins/clientInjections.ts:144–154  ·  view source on GitHub ↗
(
  config: ResolvedConfig,
)

Source from the content-addressed store, hash-verified

142}
143
144export async function getHmrImplementation(
145 config: ResolvedConfig,
146): Promise<string> {
147 const content = fs.readFileSync(normalizedClientEntry, 'utf-8')
148 const replacer = await createClientConfigValueReplacer(config)
149 return (
150 replacer(content)
151 // the rolldown runtime cannot import a module
152 .replace(/import\s*['"]@vite\/env['"]/, '')
153 )
154}

Callers 2

getRolldownOptionsMethod · 0.90
generateFallbackHtmlFunction · 0.90

Calls 2

replacerFunction · 0.85

Tested by

no test coverage detected