Home / Function/ withServe() — vite Function Reference

withServe() — vite Function Reference

Architecture documentation for the withServe() function in css-dynamic-import.spec.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  3969ccdd_98c9_225f_5f0f_ae53dbc6a63e["withServe()"]
  dd71c169_a6c5_edad_b5a0_65b1cfb5183c["css-dynamic-import.spec.ts"]
  3969ccdd_98c9_225f_5f0f_ae53dbc6a63e -->|defined in| dd71c169_a6c5_edad_b5a0_65b1cfb5183c
  c3171398_e4f5_405b_10b1_82029ca7a566["getConfig()"]
  3969ccdd_98c9_225f_5f0f_ae53dbc6a63e -->|calls| c3171398_e4f5_405b_10b1_82029ca7a566
  style 3969ccdd_98c9_225f_5f0f_ae53dbc6a63e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

playground/css-dynamic-import/__tests__/css-dynamic-import.spec.ts lines 33–45

async function withServe(base: string, fn: () => Promise<void>) {
  const config = getConfig(base)
  const server = await createServer(config)
  await server.listen()

  try {
    await page.goto(server.resolvedUrls.local[0])
    await fn()
  } finally {
    await page.goto('about:blank') // move to a different page to avoid auto-refresh after server start
    await server.close()
  }
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does withServe() do?
withServe() is a function in the vite codebase, defined in playground/css-dynamic-import/__tests__/css-dynamic-import.spec.ts.
Where is withServe() defined?
withServe() is defined in playground/css-dynamic-import/__tests__/css-dynamic-import.spec.ts at line 33.
What does withServe() call?
withServe() calls 1 function(s): getConfig.

Analyze Your Own Codebase

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

Try Supermodel Free