vitestSetup.ts — vite Source File
Architecture documentation for vitestSetup.ts, a typescript file in the vite codebase. 7 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 804dc5f9_3eef_472e_8575_1233b4358f17["vitestSetup.ts"] 946bdba3_227b_3fc0_1b4c_ddbdb281f454["node:http"] 804dc5f9_3eef_472e_8575_1233b4358f17 --> 946bdba3_227b_3fc0_1b4c_ddbdb281f454 e6032fbc_44cf_58d6_868d_dd15106c18c5["node:fs"] 804dc5f9_3eef_472e_8575_1233b4358f17 --> e6032fbc_44cf_58d6_868d_dd15106c18c5 51e96894_3556_ed5c_1ede_97d449867adf["node:path"] 804dc5f9_3eef_472e_8575_1233b4358f17 --> 51e96894_3556_ed5c_1ede_97d449867adf daea26b3_da11_dee8_9ffd_9dbc0e857906["playwright-chromium"] 804dc5f9_3eef_472e_8575_1233b4358f17 --> daea26b3_da11_dee8_9ffd_9dbc0e857906 54c37fea_4fe7_2693_71cb_1276b77f55f9["vite"] 804dc5f9_3eef_472e_8575_1233b4358f17 --> 54c37fea_4fe7_2693_71cb_1276b77f55f9 693ca867_249b_3e5a_0ce1_8930413b7fcd["rolldown"] 804dc5f9_3eef_472e_8575_1233b4358f17 --> 693ca867_249b_3e5a_0ce1_8930413b7fcd a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"] 804dc5f9_3eef_472e_8575_1233b4358f17 --> a340ba46_b2b7_3048_3bb3_6907a74c8464 c68b21f4_9cd3_3abe_8169_0de2c9650f53["test-utils.ts"] c68b21f4_9cd3_3abe_8169_0de2c9650f53 --> 804dc5f9_3eef_472e_8575_1233b4358f17 style 804dc5f9_3eef_472e_8575_1233b4358f17 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import type * as http from 'node:http'
import fs from 'node:fs'
import path from 'node:path'
import { chromium } from 'playwright-chromium'
import type {
ConfigEnv,
InlineConfig,
Logger,
PluginOption,
ResolvedConfig,
UserConfig,
ViteDevServer,
} from 'vite'
import {
build,
createBuilder,
createServer,
loadConfigFromFile,
mergeConfig,
preview,
} from 'vite'
import type { Browser, Page } from 'playwright-chromium'
import type {
RolldownWatcher,
RolldownWatcherEvent,
RollupError,
} from 'rolldown'
import { beforeAll, expect, inject } from 'vitest'
// #region serializer
export const sourcemapSnapshot = Symbol()
const generateVisualizationLink = (code: string, map: string) => {
const utf16ToUTF8 = (x) => unescape(encodeURIComponent(x))
const convertedCode = utf16ToUTF8(code)
const convertedMap = utf16ToUTF8(map)
const hash = `${convertedCode.length}\0${convertedCode}${convertedMap.length}\0${convertedMap}`
return `https://evanw.github.io/source-map-visualization/#${btoa(hash)}`
}
expect.addSnapshotSerializer({
serialize(val, config, indentation, depth, refs, printer) {
const options = val[sourcemapSnapshot]
const map = { ...val.map }
if (options.withoutContent) {
delete map.sourcesContent
}
return `${indentation}SourceMap {
${indentation}${config.indent}content: ${printer(map, config, indentation + config.indent, depth, refs)},
${indentation}${config.indent}visualization: ${JSON.stringify(generateVisualizationLink(val.code, JSON.stringify(val.map)))}
${indentation}}`
},
test(val) {
return typeof val === 'object' && val && val[sourcemapSnapshot]
},
})
// #endregion
// ... (364 more lines)
Domain
Subdomains
Functions
Classes
Dependencies
- node:fs
- node:http
- node:path
- playwright-chromium
- rolldown
- vite
- vitest
Imported By
Source
Frequently Asked Questions
What does vitestSetup.ts do?
vitestSetup.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 vitestSetup.ts?
vitestSetup.ts defines 10 function(s): createInMemoryLogger, generateVisualizationLink, loadConfig, notifyRebuildComplete, setViteUrl, setupConsoleWarnCollector, slash, startDefaultServe, stripTrailingSlashIfNeeded, throwHtmlParseError.
What does vitestSetup.ts depend on?
vitestSetup.ts imports 7 module(s): node:fs, node:http, node:path, playwright-chromium, rolldown, vite, vitest.
What files import vitestSetup.ts?
vitestSetup.ts is imported by 1 file(s): test-utils.ts.
Where is vitestSetup.ts in the architecture?
vitestSetup.ts is located at playground/vitestSetup.ts (domain: ViteCore, subdomain: ConfigEngine, directory: playground).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free