Home / Function/ prunePaths() — vite Function Reference

prunePaths() — vite Function Reference

Architecture documentation for the prunePaths() function in hmr.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  877e0b79_8207_e08f_1255_5ea1250a15c6["prunePaths()"]
  59034bde_6f4e_fe6a_b2ce_a002a0aa10b4["HMRClient"]
  877e0b79_8207_e08f_1255_5ea1250a15c6 -->|defined in| 59034bde_6f4e_fe6a_b2ce_a002a0aa10b4
  d1f1e08a_d62c_ffc8_40e7_039fffb49665["handleMessage()"]
  d1f1e08a_d62c_ffc8_40e7_039fffb49665 -->|calls| 877e0b79_8207_e08f_1255_5ea1250a15c6
  style 877e0b79_8207_e08f_1255_5ea1250a15c6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/shared/hmr.ts lines 216–231

  public async prunePaths(paths: string[]): Promise<void> {
    await Promise.all(
      paths.map((path) => {
        const disposer = this.disposeMap.get(path)
        if (disposer) return disposer(this.dataMap.get(path))
      }),
    )
    await Promise.all(
      paths.map((path) => {
        const fn = this.pruneMap.get(path)
        if (fn) {
          return fn(this.dataMap.get(path))
        }
      }),
    )
  }

Domain

Subdomains

Called By

Frequently Asked Questions

What does prunePaths() do?
prunePaths() is a function in the vite codebase, defined in packages/vite/src/shared/hmr.ts.
Where is prunePaths() defined?
prunePaths() is defined in packages/vite/src/shared/hmr.ts at line 216.
What calls prunePaths()?
prunePaths() is called by 1 function(s): handleMessage.

Analyze Your Own Codebase

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

Try Supermodel Free