Home / Function/ hasRootFile() — vite Function Reference

hasRootFile() — vite Function Reference

Architecture documentation for the hasRootFile() function in searchRoot.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  5669f6ea_ec6f_897d_947b_d3d4f1e3e852["hasRootFile()"]
  497939be_63aa_81b3_3492_3f2698d33097["searchRoot.ts"]
  5669f6ea_ec6f_897d_947b_d3d4f1e3e852 -->|defined in| 497939be_63aa_81b3_3492_3f2698d33097
  f00607d5_f936_a7c7_9f17_a6349edeac83["searchForWorkspaceRoot()"]
  f00607d5_f936_a7c7_9f17_a6349edeac83 -->|calls| 5669f6ea_ec6f_897d_947b_d3d4f1e3e852
  style 5669f6ea_ec6f_897d_947b_d3d4f1e3e852 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/searchRoot.ts lines 38–40

function hasRootFile(root: string): boolean {
  return ROOT_FILES.some((file) => fs.existsSync(join(root, file)))
}

Domain

Subdomains

Frequently Asked Questions

What does hasRootFile() do?
hasRootFile() is a function in the vite codebase, defined in packages/vite/src/node/server/searchRoot.ts.
Where is hasRootFile() defined?
hasRootFile() is defined in packages/vite/src/node/server/searchRoot.ts at line 38.
What calls hasRootFile()?
hasRootFile() is called by 1 function(s): searchForWorkspaceRoot.

Analyze Your Own Codebase

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

Try Supermodel Free