Home / Function/ toOutputFilePathWithoutRuntime() — vite Function Reference

toOutputFilePathWithoutRuntime() — vite Function Reference

Architecture documentation for the toOutputFilePathWithoutRuntime() function in build.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  1885244d_73cb_eb0f_8367_95dfedd97d7c["toOutputFilePathWithoutRuntime()"]
  45981d85_cbdd_e969_8c88_c17072ea0eda["build.ts"]
  1885244d_73cb_eb0f_8367_95dfedd97d7c -->|defined in| 45981d85_cbdd_e969_8c88_c17072ea0eda
  c9db8630_93b3_267d_8e26_8b62626a11ca["joinUrlSegments()"]
  1885244d_73cb_eb0f_8367_95dfedd97d7c -->|calls| c9db8630_93b3_267d_8e26_8b62626a11ca
  style 1885244d_73cb_eb0f_8367_95dfedd97d7c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/build.ts lines 1643–1678

export function toOutputFilePathWithoutRuntime(
  filename: string,
  type: 'asset' | 'public',
  hostId: string,
  hostType: 'js' | 'css' | 'html',
  config: ResolvedConfig,
  toRelative: (filename: string, hostId: string) => string,
): string {
  const { renderBuiltUrl } = config.experimental
  let relative = config.base === '' || config.base === './'
  if (renderBuiltUrl) {
    const result = renderBuiltUrl(filename, {
      hostId,
      hostType,
      type,
      ssr: !!config.build.ssr,
    })
    if (typeof result === 'object') {
      if (result.runtime) {
        throw new Error(
          `{ runtime: "${result.runtime}" } is not supported for assets in ${hostType} files: ${filename}`,
        )
      }
      if (typeof result.relative === 'boolean') {
        relative = result.relative
      }
    } else if (result) {
      return result
    }
  }
  if (relative && !config.build.ssr) {
    return toRelative(filename, hostId)
  } else {
    return joinUrlSegments(config.decodedBase, filename)
  }
}

Domain

Subdomains

Frequently Asked Questions

What does toOutputFilePathWithoutRuntime() do?
toOutputFilePathWithoutRuntime() is a function in the vite codebase, defined in packages/vite/src/node/build.ts.
Where is toOutputFilePathWithoutRuntime() defined?
toOutputFilePathWithoutRuntime() is defined in packages/vite/src/node/build.ts at line 1643.
What does toOutputFilePathWithoutRuntime() call?
toOutputFilePathWithoutRuntime() calls 1 function(s): joinUrlSegments.

Analyze Your Own Codebase

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

Try Supermodel Free