Home / File/ serve.ts — vite Source File

serve.ts — vite Source File

Architecture documentation for serve.ts, a typescript file in the vite codebase. 2 imports, 0 dependents.

File typescript ViteCore ConfigEngine 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  a657842b_85c2_e980_4bc8_cf15be13a5fb["serve.ts"]
  51e96894_3556_ed5c_1ede_97d449867adf["node:path"]
  a657842b_85c2_e980_4bc8_cf15be13a5fb --> 51e96894_3556_ed5c_1ede_97d449867adf
  d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"]
  a657842b_85c2_e980_4bc8_cf15be13a5fb --> d3fd5575_295b_d6be_24dd_62d277645dc9
  style a657842b_85c2_e980_4bc8_cf15be13a5fb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// this is automatically detected by playground/vitestSetup.ts and will replace
// the default e2e test serve behavior

import path from 'node:path'
import { rootDir, setViteUrl } from '~utils'

export async function serve(): Promise<{ close(): Promise<void> }> {
  const vite = await import('vite')
  const rootServer = await vite.createServer({
    root: rootDir,
    logLevel: 'silent',
  })
  const otherServer = await vite.createServer({
    root: path.join(rootDir, 'other-app'),
    logLevel: 'silent',
  })

  await Promise.all([rootServer.listen(), otherServer.listen()])
  const viteUrl = rootServer.resolvedUrls.local[0]
  setViteUrl(viteUrl)

  return {
    async close() {
      await Promise.all([rootServer.close(), otherServer.close()])
    },
  }
}

Domain

Subdomains

Functions

Dependencies

  • node:path
  • ~utils

Frequently Asked Questions

What does serve.ts do?
serve.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain, ConfigEngine subdomain.
What functions are defined in serve.ts?
serve.ts defines 1 function(s): serve.
What does serve.ts depend on?
serve.ts imports 2 module(s): node:path, ~utils.
Where is serve.ts in the architecture?
serve.ts is located at playground/proxy-hmr/__tests__/serve.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground/proxy-hmr/__tests__).

Analyze Your Own Codebase

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

Try Supermodel Free