Home / Function/ getBaseInHTML() — vite Function Reference

getBaseInHTML() — vite Function Reference

Architecture documentation for the getBaseInHTML() function in html.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  28465a50_606a_e9ed_0f86_7578ef3217b6["getBaseInHTML()"]
  f8fe0737_718a_5509_b722_473f207d5906["html.ts"]
  28465a50_606a_e9ed_0f86_7578ef3217b6 -->|defined in| f8fe0737_718a_5509_b722_473f207d5906
  39f26be8_b1d9_a756_3043_474687a6bbb7["buildHtmlPlugin()"]
  39f26be8_b1d9_a756_3043_474687a6bbb7 -->|calls| 28465a50_606a_e9ed_0f86_7578ef3217b6
  style 28465a50_606a_e9ed_0f86_7578ef3217b6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/html.ts lines 1431–1440

function getBaseInHTML(urlRelativePath: string, config: ResolvedConfig) {
  // Prefer explicit URL if defined for linking to assets and public files from HTML,
  // even when base relative is specified
  return config.base === './' || config.base === ''
    ? path.posix.join(
        path.posix.relative(urlRelativePath, '').slice(0, -2),
        './',
      )
    : config.base
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getBaseInHTML() do?
getBaseInHTML() is a function in the vite codebase, defined in packages/vite/src/node/plugins/html.ts.
Where is getBaseInHTML() defined?
getBaseInHTML() is defined in packages/vite/src/node/plugins/html.ts at line 1431.
What calls getBaseInHTML()?
getBaseInHTML() is called by 1 function(s): buildHtmlPlugin.

Analyze Your Own Codebase

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

Try Supermodel Free