Home / File/ utils.ts — vite Source File

utils.ts — vite Source File

Architecture documentation for utils.ts, a typescript file in the vite codebase. 44 imports, 75 dependents.

File typescript ViteCore ConfigEngine 44 imports 75 dependents 108 functions

Entity Profile

Dependency Diagram

graph LR
  031bc221_67a8_c579_f2bf_bb30a08beeb2["utils.ts"]
  abfc9e70_3c15_b3f0_a595_3cf27afb7e64["utils.ts"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> abfc9e70_3c15_b3f0_a595_3cf27afb7e64
  10b9dea8_362c_1af2_93be_afa4dd9aed9e["cleanUrl"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 10b9dea8_362c_1af2_93be_afa4dd9aed9e
  f094d39d_cd97_2548_86c3_38902c2f3301["slash"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> f094d39d_cd97_2548_86c3_38902c2f3301
  09d0a948_4a89_8bbc_50ce_129fc70dbd66["splitFileAndPostfix"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 09d0a948_4a89_8bbc_50ce_129fc70dbd66
  1a3bec7b_1a11_316f_5831_a0535b829bbf["withTrailingSlash"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 1a3bec7b_1a11_316f_5831_a0535b829bbf
  ffe942a0_fdea_ef58_0f68_6f1fec25f285["constants.ts"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> ffe942a0_fdea_ef58_0f68_6f1fec25f285
  58ae8bb3_1e86_ef80_62f2_c3c6b3a5d4dd["builtin.ts"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 58ae8bb3_1e86_ef80_62f2_c3c6b3a5d4dd
  eb16f54b_f518_e287_d712_4a0d7705bdff["createIsBuiltin"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> eb16f54b_f518_e287_d712_4a0d7705bdff
  545df65b_7f67_94d3_e2e8_a592d5e64b8f["constants.ts"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 545df65b_7f67_94d3_e2e8_a592d5e64b8f
  2f328851_91ee_fb05_63f0_4f466b9d6250["index.ts"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 2f328851_91ee_fb05_63f0_4f466b9d6250
  1f4f2d3b_4db2_6576_35cb_ce0412606f63["DepOptimizationOptions"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 1f4f2d3b_4db2_6576_35cb_ce0412606f63
  7da774f9_eca5_d54e_6e01_6bee7d460a2b["config.ts"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> 7da774f9_eca5_d54e_6e01_6bee7d460a2b
  eb5604c2_58e1_1c00_5a1a_5d97ea5236ad["ResolvedConfig"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> eb5604c2_58e1_1c00_5a1a_5d97ea5236ad
  a423a1ed_f7d8_0eb5_9b8f_ddfa7fa8147e["index.ts"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2 --> a423a1ed_f7d8_0eb5_9b8f_ddfa7fa8147e
  style 031bc221_67a8_c579_f2bf_bb30a08beeb2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs'
import os from 'node:os'
import net from 'node:net'
import path from 'node:path'
import { exec } from 'node:child_process'
import crypto from 'node:crypto'
import { fileURLToPath } from 'node:url'
import type { ServerOptions as HttpsServerOptions } from 'node:https'
import { builtinModules } from 'node:module'
import { promises as dns } from 'node:dns'
import { performance } from 'node:perf_hooks'
import type { AddressInfo, Server } from 'node:net'
import fsp from 'node:fs/promises'
import remapping from '@jridgewell/remapping'
import type { DecodedSourceMap, RawSourceMap } from '@jridgewell/remapping'
import colors from 'picocolors'
import type { Debugger } from 'obug'
import debug from 'obug'
import type MagicString from 'magic-string'
import type { Equal } from '@type-challenges/utils'

import type { TransformResult } from 'rolldown'
import { createFilter as _createFilter } from '@rollup/pluginutils'
import type { Alias, AliasOptions } from '#dep-types/alias'
import type { FSWatcher } from '#dep-types/chokidar'
import {
  cleanUrl,
  isWindows,
  slash,
  splitFileAndPostfix,
  withTrailingSlash,
} from '../shared/utils'
import { VALID_ID_PREFIX } from '../shared/constants'
import { createIsBuiltin } from '../shared/builtin'
import {
  CLIENT_ENTRY,
  CLIENT_PUBLIC_PATH,
  CSS_LANGS_RE,
  ENV_PUBLIC_PATH,
  FS_PREFIX,
  OPTIMIZABLE_ENTRY_RE,
  loopbackHosts,
  wildcardHosts,
} from './constants'
import type { DepOptimizationOptions } from './optimizer'
import type { ResolvedConfig } from './config'
import type { ResolvedServerUrls, ViteDevServer } from './server'
import type { PreviewServer } from './preview'
import { type PackageCache, findNearestPackageData } from './packages'
import type { BuildEnvironmentOptions } from './build'
import type { CommonServerOptions } from '.'

/**
 * Inlined to keep `@rollup/pluginutils` in devDependencies
 */
export type FilterPattern =
  | ReadonlyArray<string | RegExp>
  | string
  | RegExp
  | null
// ... (1706 more lines)

Domain

Subdomains

Functions

Dependencies

Imported By

Frequently Asked Questions

What does utils.ts do?
utils.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 utils.ts?
utils.ts defines 108 function(s): arraify, arrayEqual, asyncFlatten, asyncReplace, backwardCompatibleWorkerPlugins, blankReplacer, combineSourcemaps, copyDir, createDebugger, createSerialPromiseQueue, and 98 more.
What does utils.ts depend on?
utils.ts imports 44 module(s): ., BuildEnvironmentOptions, DepOptimizationOptions, PreviewServer, ResolvedConfig, ResolvedServerUrls, ViteDevServer, alias, and 36 more.
What files import utils.ts?
utils.ts is imported by 75 file(s): asset.ts, assetImportMetaUrl.ts, base.ts, build.ts, clientInjections.ts, config.spec.ts, config.ts, config.ts, and 67 more.
Where is utils.ts in the architecture?
utils.ts is located at packages/vite/src/node/utils.ts (domain: ViteCore, subdomain: ConfigEngine, directory: packages/vite/src/node).

Analyze Your Own Codebase

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

Try Supermodel Free