Home / Function/ getShortName() — vite Function Reference

getShortName() — vite Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2ff971ab_04c3_0402_34fc_dc2f5f3103ec["getShortName()"]
  18db4f26_79f1_5b7d_b291_4feeaf95538f["hmr.ts"]
  2ff971ab_04c3_0402_34fc_dc2f5f3103ec -->|defined in| 18db4f26_79f1_5b7d_b291_4feeaf95538f
  dd164f22_a6d3_7e8d_43c3_45e219e70176["invalidateModule()"]
  dd164f22_a6d3_7e8d_43c3_45e219e70176 -->|calls| 2ff971ab_04c3_0402_34fc_dc2f5f3103ec
  2ccc36f4_103c_b60e_efaa_01ea14db6138["handleHmrOutput()"]
  2ccc36f4_103c_b60e_efaa_01ea14db6138 -->|calls| 2ff971ab_04c3_0402_34fc_dc2f5f3103ec
  8f73b680_d5b9_383c_f695_c906b80fb1e6["handleHMRUpdate()"]
  8f73b680_d5b9_383c_f695_c906b80fb1e6 -->|calls| 2ff971ab_04c3_0402_34fc_dc2f5f3103ec
  1a3bec7b_1a11_316f_5831_a0535b829bbf["withTrailingSlash()"]
  2ff971ab_04c3_0402_34fc_dc2f5f3103ec -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf
  style 2ff971ab_04c3_0402_34fc_dc2f5f3103ec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/hmr.ts lines 112–116

export function getShortName(file: string, root: string): string {
  return file.startsWith(withTrailingSlash(root))
    ? path.posix.relative(root, file)
    : file
}

Domain

Subdomains

Frequently Asked Questions

What does getShortName() do?
getShortName() is a function in the vite codebase, defined in packages/vite/src/node/server/hmr.ts.
Where is getShortName() defined?
getShortName() is defined in packages/vite/src/node/server/hmr.ts at line 112.
What does getShortName() call?
getShortName() calls 1 function(s): withTrailingSlash.
What calls getShortName()?
getShortName() is called by 3 function(s): handleHMRUpdate, handleHmrOutput, invalidateModule.

Analyze Your Own Codebase

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

Try Supermodel Free