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

Method prunePaths

packages/vite/src/shared/hmr.ts:216–231  ·  view source on GitHub ↗
(paths: string[])

Source from the content-addressed store, hash-verified

214 // but they may have left behind side effects that need to be cleaned up
215 // (e.g. style injections)
216 public async prunePaths(paths: string[]): Promise<void> {
217 await Promise.all(
218 paths.map((path) => {
219 const disposer = this.disposeMap.get(path)
220 if (disposer) return disposer(this.dataMap.get(path))
221 }),
222 )
223 await Promise.all(
224 paths.map((path) => {
225 const fn = this.pruneMap.get(path)
226 if (fn) {
227 return fn(this.dataMap.get(path))
228 }
229 }),
230 )
231 }
232
233 protected warnFailedUpdate(err: Error, path: string | string[]): void {
234 if (!(err instanceof Error) || !err.message.includes('fetch')) {

Callers 2

handleMessageFunction · 0.80

Calls 2

fnFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected