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

Function hotUpdate

playground/hmr/vite.config.ts:39–46  ·  view source on GitHub ↗
({ file, read })

Source from the content-addressed store, hash-verified

37 {
38 name: 'mock-custom',
39 async hotUpdate({ file, read }) {
40 if (file.endsWith('customFile.js')) {
41 const content = await read()
42 const msg = content.match(/export const msg = '(\w+)'/)[1]
43 this.environment.hot.send('custom:foo', { msg })
44 this.environment.hot.send('custom:remove', { msg })
45 }
46 },
47 configureServer(server) {
48 server.environments.client.hot.on(
49 'custom:remote-add',

Callers

nothing calls this directly

Calls 2

sendMethod · 0.65
readFunction · 0.50

Tested by

no test coverage detected