serve.ts — vite Source File
Architecture documentation for serve.ts, a typescript file in the vite codebase. 3 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 5c0af01c_9641_2df9_06f7_af0530839340["serve.ts"] 51e96894_3556_ed5c_1ede_97d449867adf["node:path"] 5c0af01c_9641_2df9_06f7_af0530839340 --> 51e96894_3556_ed5c_1ede_97d449867adf c61c7da5_ab1b_2881_075e_127cc87cab93["kill-port"] 5c0af01c_9641_2df9_06f7_af0530839340 --> c61c7da5_ab1b_2881_075e_127cc87cab93 d3fd5575_295b_d6be_24dd_62d277645dc9["~utils"] 5c0af01c_9641_2df9_06f7_af0530839340 --> d3fd5575_295b_d6be_24dd_62d277645dc9 6167cd94_1735_44bf_fed4_dd59c166295d["ssr-pug.spec.ts"] 6167cd94_1735_44bf_fed4_dd59c166295d --> 5c0af01c_9641_2df9_06f7_af0530839340 style 5c0af01c_9641_2df9_06f7_af0530839340 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 kill from 'kill-port'
import { hmrPorts, ports, rootDir } from '~utils'
export const port = ports['ssr-pug']
export async function serve(): Promise<{ close(): Promise<void> }> {
await kill(port)
const { createServer } = await import(path.resolve(rootDir, 'server.js'))
const { app, vite } = await createServer(rootDir, hmrPorts['ssr-pug'])
return new Promise((resolve, reject) => {
try {
const server = app.listen(port, () => {
resolve({
// for test teardown
async close() {
await new Promise((resolve) => {
server.close(resolve)
})
if (vite) {
await vite.close()
}
},
})
})
} catch (e) {
reject(e)
}
})
}
Domain
Subdomains
Functions
Dependencies
- kill-port
- node:path
- ~utils
Imported By
Source
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 3 module(s): kill-port, node:path, ~utils.
What files import serve.ts?
serve.ts is imported by 1 file(s): ssr-pug.spec.ts.
Where is serve.ts in the architecture?
serve.ts is located at playground/ssr-pug/__tests__/serve.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground/ssr-pug/__tests__).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free