Home / Function/ handlePrunedModules() — vite Function Reference

handlePrunedModules() — vite Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2f681ea7_f0dd_ef5c_cb52_1396d02e37d7["handlePrunedModules()"]
  18db4f26_79f1_5b7d_b291_4feeaf95538f["hmr.ts"]
  2f681ea7_f0dd_ef5c_cb52_1396d02e37d7 -->|defined in| 18db4f26_79f1_5b7d_b291_4feeaf95538f
  a1fc1de5_905b_efe7_d960_3597604fbdfe["importAnalysisPlugin()"]
  a1fc1de5_905b_efe7_d960_3597604fbdfe -->|calls| 2f681ea7_f0dd_ef5c_cb52_1396d02e37d7
  74ee9886_2456_3964_e90e_5fc67925229d["monotonicDateNow()"]
  2f681ea7_f0dd_ef5c_cb52_1396d02e37d7 -->|calls| 74ee9886_2456_3964_e90e_5fc67925229d
  style 2f681ea7_f0dd_ef5c_cb52_1396d02e37d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/hmr.ts lines 923–940

export function handlePrunedModules(
  mods: Set<EnvironmentModuleNode>,
  { hot }: DevEnvironment,
): void {
  // update the disposed modules' hmr timestamp
  // since if it's re-imported, it should re-apply side effects
  // and without the timestamp the browser will not re-import it!
  const t = monotonicDateNow()
  mods.forEach((mod) => {
    mod.lastHMRTimestamp = t
    mod.lastHMRInvalidationReceived = false
    debugHmr?.(`[dispose] ${colors.dim(mod.file)}`)
  })
  hot.send({
    type: 'prune',
    paths: [...mods].map((m) => m.url),
  })
}

Domain

Subdomains

Frequently Asked Questions

What does handlePrunedModules() do?
handlePrunedModules() is a function in the vite codebase, defined in packages/vite/src/node/server/hmr.ts.
Where is handlePrunedModules() defined?
handlePrunedModules() is defined in packages/vite/src/node/server/hmr.ts at line 923.
What does handlePrunedModules() call?
handlePrunedModules() calls 1 function(s): monotonicDateNow.
What calls handlePrunedModules()?
handlePrunedModules() is called by 1 function(s): importAnalysisPlugin.

Analyze Your Own Codebase

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

Try Supermodel Free