Home / Function/ removeBundle() — vite Function Reference

removeBundle() — vite Function Reference

Architecture documentation for the removeBundle() function in worker.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  7a6e5acd_02c1_222f_f1f8_805ba7ef6b50["removeBundle()"]
  0d0d0914_5b8b_6a47_5174_e7974dd8084e["WorkerOutputCache"]
  7a6e5acd_02c1_222f_f1f8_805ba7ef6b50 -->|defined in| 0d0d0914_5b8b_6a47_5174_e7974dd8084e
  3a996af5_4903_3cfe_6bc5_bcf4f52114c9["removeBundleIfInvalidated()"]
  3a996af5_4903_3cfe_6bc5_bcf4f52114c9 -->|calls| 7a6e5acd_02c1_222f_f1f8_805ba7ef6b50
  51afdf58_3045_64b1_cf5b_929b1091e877["get()"]
  7a6e5acd_02c1_222f_f1f8_805ba7ef6b50 -->|calls| 51afdf58_3045_64b1_cf5b_929b1091e877
  9d025481_71dc_8fbb_c07e_b6e74a08a45a["getHash()"]
  7a6e5acd_02c1_222f_f1f8_805ba7ef6b50 -->|calls| 9d025481_71dc_8fbb_c07e_b6e74a08a45a
  style 7a6e5acd_02c1_222f_f1f8_805ba7ef6b50 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/worker.ts lines 113–129

  private removeBundle(file: string) {
    const bundle = this.bundles.get(file)
    if (!bundle) return

    this.bundles.delete(file)
    this.fileNameHash.delete(getHash(bundle.entryFilename))

    this.assets.delete(bundle.entryFilename)

    const keptBundles = [...this.bundles.values()]
    // remove assets that are only referenced by this bundle
    for (const asset of bundle.referencedAssets) {
      if (keptBundles.every((b) => !b.referencedAssets.has(asset))) {
        this.assets.delete(asset)
      }
    }
  }

Domain

Subdomains

Frequently Asked Questions

What does removeBundle() do?
removeBundle() is a function in the vite codebase, defined in packages/vite/src/node/plugins/worker.ts.
Where is removeBundle() defined?
removeBundle() is defined in packages/vite/src/node/plugins/worker.ts at line 113.
What does removeBundle() call?
removeBundle() calls 2 function(s): get, getHash.
What calls removeBundle()?
removeBundle() is called by 1 function(s): removeBundleIfInvalidated.

Analyze Your Own Codebase

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

Try Supermodel Free