Home / Function/ invalidate() — vite Function Reference

invalidate() — vite Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8734724b_d91d_59c5_6ae1_9c54c972eea0["invalidate()"]
  d86a8333_3c9a_922b_57b2_926575326289["HMRContext"]
  8734724b_d91d_59c5_6ae1_9c54c972eea0 -->|defined in| d86a8333_3c9a_922b_57b2_926575326289
  6cbd2953_6c7a_3620_4afe_54813dab91b1["send()"]
  8734724b_d91d_59c5_6ae1_9c54c972eea0 -->|calls| 6cbd2953_6c7a_3620_4afe_54813dab91b1
  efd2ed23_9225_aef5_6607_d3415a0b5352["notifyListeners()"]
  8734724b_d91d_59c5_6ae1_9c54c972eea0 -->|calls| efd2ed23_9225_aef5_6607_d3415a0b5352
  style 8734724b_d91d_59c5_6ae1_9c54c972eea0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/shared/hmr.ts lines 99–115

  invalidate(message: string): void {
    const firstInvalidatedBy =
      this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath
    this.hmrClient.notifyListeners('vite:invalidate', {
      path: this.ownerPath,
      message,
      firstInvalidatedBy,
    })
    this.send('vite:invalidate', {
      path: this.ownerPath,
      message,
      firstInvalidatedBy,
    })
    this.hmrClient.logger.debug(
      `invalidate ${this.ownerPath}${message ? `: ${message}` : ''}`,
    )
  }

Domain

Subdomains

Frequently Asked Questions

What does invalidate() do?
invalidate() is a function in the vite codebase, defined in packages/vite/src/shared/hmr.ts.
Where is invalidate() defined?
invalidate() is defined in packages/vite/src/shared/hmr.ts at line 99.
What does invalidate() call?
invalidate() calls 2 function(s): notifyListeners, send.

Analyze Your Own Codebase

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

Try Supermodel Free