Home / File/ resolve.ts — vite Source File

resolve.ts — vite Source File

Architecture documentation for resolve.ts, a typescript file in the vite codebase. 45 imports, 12 dependents.

File typescript PluginSystem AssetManagement 45 imports 12 dependents 24 functions

Entity Profile

Dependency Diagram

graph LR
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3["resolve.ts"]
  5abb8c87_ffcb_f2d4_7421_e36705d9e5c7["plugin.ts"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 5abb8c87_ffcb_f2d4_7421_e36705d9e5c7
  1dc2cf7d_5d97_c778_8c33_6449a7607aef["Plugin"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 1dc2cf7d_5d97_c778_8c33_6449a7607aef
  545df65b_7f67_94d3_e2e8_a592d5e64b8f["constants.ts"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 545df65b_7f67_94d3_e2e8_a592d5e64b8f
  031bc221_67a8_c579_f2bf_bb30a08beeb2["utils.ts"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 031bc221_67a8_c579_f2bf_bb30a08beeb2
  23a2e685_f919_9578_27ba_bde71c122058["createDebugger"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 23a2e685_f919_9578_27ba_bde71c122058
  2f0da199_9f02_5b00_9a83_0406650f871a["fsPathFromId"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 2f0da199_9f02_5b00_9a83_0406650f871a
  cb293321_1174_554d_b5ce_f153b06a2fb4["getNpmPackageName"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> cb293321_1174_554d_b5ce_f153b06a2fb4
  1948f092_e5a5_076b_2f59_79ef22dec191["injectQuery"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 1948f092_e5a5_076b_2f59_79ef22dec191
  5d2580c9_3b65_7396_afe1_ab2aa13f8ed9["isBuiltin"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 5d2580c9_3b65_7396_afe1_ab2aa13f8ed9
  298b86d6_4810_9884_d5fa_3e3077e2206a["isDataUrl"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 298b86d6_4810_9884_d5fa_3e3077e2206a
  23257aa1_5e3f_7e6e_1b43_875b139e4ec5["isExternalUrl"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 23257aa1_5e3f_7e6e_1b43_875b139e4ec5
  50ac7e51_9f94_e985_bfec_ae95273b23b0["isInNodeModules"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 50ac7e51_9f94_e985_bfec_ae95273b23b0
  2aff86e8_0c9d_22cb_6536_c1321e1aaa1d["isObject"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 2aff86e8_0c9d_22cb_6536_c1321e1aaa1d
  908e9e35_950f_ad37_ffa9_0058622aa7e8["isOptimizable"]
  dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 --> 908e9e35_950f_ad37_ffa9_0058622aa7e8
  style dcff87b0_a8ea_57a2_3b29_a7b8f19986f3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs'
import path from 'node:path'
import colors from 'picocolors'
import type { PartialResolvedId } from 'rolldown'
import { viteResolvePlugin } from 'rolldown/experimental'
import { exports, imports } from 'resolve.exports'
import { hasESMSyntax } from 'mlly'
import type { Plugin } from '../plugin'
import {
  CLIENT_ENTRY,
  DEP_VERSION_RE,
  DEV_PROD_CONDITION,
  ENV_ENTRY,
  FS_PREFIX,
  SPECIAL_QUERY_RE,
} from '../constants'
import {
  bareImportRE,
  createDebugger,
  deepImportRE,
  fsPathFromId,
  getNpmPackageName,
  injectQuery,
  isBuiltin,
  isDataUrl,
  isExternalUrl,
  isInNodeModules,
  isObject,
  isOptimizable,
  normalizePath,
  safeRealpathSync,
  tryStatSync,
} from '../utils'
import {
  isDepOptimizationDisabled,
  optimizedDepInfoFromFile,
  optimizedDepInfoFromId,
} from '../optimizer'
import type { DepsOptimizer } from '../optimizer'
import type { Environment } from '..'
import type { PackageCache, PackageData } from '../packages'
import { canExternalizeFile } from '../external'
import {
  findNearestMainPackageData,
  findNearestPackageData,
  loadPackageData,
  resolvePackageData,
} from '../packages'
import {
  cleanUrl,
  splitFileAndPostfix,
  withTrailingSlash,
} from '../../shared/utils'
import type { ResolvedConfig, ResolvedEnvironmentOptions } from '../config'

const normalizedClientEntry = normalizePath(CLIENT_ENTRY)
const normalizedEnvEntry = normalizePath(ENV_ENTRY)

const ERR_RESOLVE_PACKAGE_ENTRY_FAIL = 'ERR_RESOLVE_PACKAGE_ENTRY_FAIL'

// ... (1183 more lines)

Domain

Subdomains

Frequently Asked Questions

What does resolve.ts do?
resolve.ts is a source file in the vite codebase, written in typescript. It belongs to the PluginSystem domain, AssetManagement subdomain.
What functions are defined in resolve.ts?
resolve.ts defines 24 function(s): ensureVersionQuery, equalWithoutSuffix, findNearestPackagePath, getConditions, getRealPath, isDirectory, isPossibleTsOutput, mapWithBrowserField, optimizerResolvePlugin, oxcResolvePlugin, and 14 more.
What does resolve.ts depend on?
resolve.ts imports 45 module(s): .., DepsOptimizer, PackageCache, PackageData, Plugin, ResolvedConfig, ResolvedEnvironmentOptions, canExternalizeFile, and 37 more.
What files import resolve.ts?
resolve.ts is imported by 12 file(s): assetImportMetaUrl.ts, config.ts, external.ts, fetchModule.ts, idResolver.ts, importAnalysis.ts, index.ts, nodeResolve.ts, and 4 more.
Where is resolve.ts in the architecture?
resolve.ts is located at packages/vite/src/node/plugins/resolve.ts (domain: PluginSystem, subdomain: AssetManagement, directory: packages/vite/src/node/plugins).

Analyze Your Own Codebase

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

Try Supermodel Free