Home / Function/ getModulesEntrypoints() — vite Function Reference

getModulesEntrypoints() — vite Function Reference

Architecture documentation for the getModulesEntrypoints() function in hmrHandler.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  d1c0dc20_450c_ceda_3165_c052a37fc95f["getModulesEntrypoints()"]
  569b12a9_015e_564e_efd3_205cedee54dd["hmrHandler.ts"]
  d1c0dc20_450c_ceda_3165_c052a37fc95f -->|defined in| 569b12a9_015e_564e_efd3_205cedee54dd
  4cffe7ac_42fc_d6b8_b38b_87a95e695952["createHMRHandlerForRunner()"]
  4cffe7ac_42fc_d6b8_b38b_87a95e695952 -->|calls| d1c0dc20_450c_ceda_3165_c052a37fc95f
  style d1c0dc20_450c_ceda_3165_c052a37fc95f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/module-runner/hmrHandler.ts lines 95–117

function getModulesEntrypoints(
  runner: ModuleRunner,
  modules: string[],
  visited = new Set<string>(),
  entrypoints = new Set<string>(),
) {
  for (const moduleId of modules) {
    if (visited.has(moduleId)) continue
    visited.add(moduleId)
    const module = runner.evaluatedModules.getModuleById(moduleId)
    if (!module) {
      continue
    }
    if (!module.importers.size) {
      entrypoints.add(module.url)
      continue
    }
    for (const importer of module.importers) {
      getModulesEntrypoints(runner, [importer], visited, entrypoints)
    }
  }
  return entrypoints
}

Domain

Subdomains

Frequently Asked Questions

What does getModulesEntrypoints() do?
getModulesEntrypoints() is a function in the vite codebase, defined in packages/vite/src/module-runner/hmrHandler.ts.
Where is getModulesEntrypoints() defined?
getModulesEntrypoints() is defined in packages/vite/src/module-runner/hmrHandler.ts at line 95.
What calls getModulesEntrypoints()?
getModulesEntrypoints() is called by 1 function(s): createHMRHandlerForRunner.

Analyze Your Own Codebase

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

Try Supermodel Free