Home / Function/ extractStack() — vite Function Reference

extractStack() — vite Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  87db59b7_cd95_f474_5a57_d5262adfb451["extractStack()"]
  45981d85_cbdd_e969_8c88_c17072ea0eda["build.ts"]
  87db59b7_cd95_f474_5a57_d5262adfb451 -->|defined in| 45981d85_cbdd_e969_8c88_c17072ea0eda
  365dd1a8_292f_ae21_8f83_1ecfde441d37["enhanceRollupError()"]
  365dd1a8_292f_ae21_8f83_1ecfde441d37 -->|calls| 87db59b7_cd95_f474_5a57_d5262adfb451
  style 87db59b7_cd95_f474_5a57_d5262adfb451 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/build.ts lines 921–935

function extractStack(e: RollupError) {
  const { stack, name = 'Error', message } = e

  // If we don't have a stack, not much we can do.
  if (!stack) {
    return stack
  }

  const expectedPrefix = `${name}: ${message}\n`
  if (stack.startsWith(expectedPrefix)) {
    return stack.slice(expectedPrefix.length)
  }

  return stack
}

Domain

Subdomains

Frequently Asked Questions

What does extractStack() do?
extractStack() is a function in the vite codebase, defined in packages/vite/src/node/build.ts.
Where is extractStack() defined?
extractStack() is defined in packages/vite/src/node/build.ts at line 921.
What calls extractStack()?
extractStack() is called by 1 function(s): enhanceRollupError.

Analyze Your Own Codebase

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

Try Supermodel Free