Home / Function/ _getModuleSetUnion() — vite Function Reference

_getModuleSetUnion() — vite Function Reference

Architecture documentation for the _getModuleSetUnion() function in mixedModuleGraph.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  22f5b773_924c_1cf6_caaf_d894ee1a4c3c["_getModuleSetUnion()"]
  8168c2c0_6927_0878_8876_5fb50d36ade9["ModuleNode"]
  22f5b773_924c_1cf6_caaf_d894ee1a4c3c -->|defined in| 8168c2c0_6927_0878_8876_5fb50d36ade9
  3019aa07_af21_9a9c_3ba4_953c8a80f053["importers()"]
  3019aa07_af21_9a9c_3ba4_953c8a80f053 -->|calls| 22f5b773_924c_1cf6_caaf_d894ee1a4c3c
  c12dd0a3_de56_aa6e_b901_e05c792f5c67["importedModules()"]
  c12dd0a3_de56_aa6e_b901_e05c792f5c67 -->|calls| 22f5b773_924c_1cf6_caaf_d894ee1a4c3c
  d8391f75_fffc_b831_70c9_fb964a1caf82["getBackwardCompatibleModuleNode()"]
  22f5b773_924c_1cf6_caaf_d894ee1a4c3c -->|calls| d8391f75_fffc_b831_70c9_fb964a1caf82
  style 22f5b773_924c_1cf6_caaf_d894ee1a4c3c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/mixedModuleGraph.ts lines 59–82

  _getModuleSetUnion(prop: 'importedModules' | 'importers'): Set<ModuleNode> {
    // A good approximation to the previous logic that returned the union of
    // the importedModules and importers from both the browser and server
    const importedModules = new Set<ModuleNode>()
    const ids = new Set<string>()
    if (this._clientModule) {
      for (const mod of this._clientModule[prop]) {
        if (mod.id) ids.add(mod.id)
        importedModules.add(
          this._moduleGraph.getBackwardCompatibleModuleNode(mod),
        )
      }
    }
    if (this._ssrModule) {
      for (const mod of this._ssrModule[prop]) {
        if (mod.id && !ids.has(mod.id)) {
          importedModules.add(
            this._moduleGraph.getBackwardCompatibleModuleNode(mod),
          )
        }
      }
    }
    return importedModules
  }

Domain

Subdomains

Frequently Asked Questions

What does _getModuleSetUnion() do?
_getModuleSetUnion() is a function in the vite codebase, defined in packages/vite/src/node/server/mixedModuleGraph.ts.
Where is _getModuleSetUnion() defined?
_getModuleSetUnion() is defined in packages/vite/src/node/server/mixedModuleGraph.ts at line 59.
What does _getModuleSetUnion() call?
_getModuleSetUnion() calls 1 function(s): getBackwardCompatibleModuleNode.
What calls _getModuleSetUnion()?
_getModuleSetUnion() is called by 2 function(s): importedModules, importers.

Analyze Your Own Codebase

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

Try Supermodel Free