scan.ts — vite Source File
Architecture documentation for scan.ts, a typescript file in the vite codebase. 32 imports, 4 dependents.
Entity Profile
Dependency Diagram
graph LR 6c7a7f5e_5d30_3576_49bf_9041362fd3fd["scan.ts"] 545df65b_7f67_94d3_e2e8_a592d5e64b8f["constants.ts"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 545df65b_7f67_94d3_e2e8_a592d5e64b8f 031bc221_67a8_c579_f2bf_bb30a08beeb2["utils.ts"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 031bc221_67a8_c579_f2bf_bb30a08beeb2 19ce2051_6a74_4b8b_104d_ec006cd7075f["arraify"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 19ce2051_6a74_4b8b_104d_ec006cd7075f 40f91c1f_e515_2c03_9628_3e4ba2691b70["asyncFlatten"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 40f91c1f_e515_2c03_9628_3e4ba2691b70 23a2e685_f919_9578_27ba_bde71c122058["createDebugger"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 23a2e685_f919_9578_27ba_bde71c122058 b6280368_17dd_ad13_70a4_cedf3c942394["deepClone"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> b6280368_17dd_ad13_70a4_cedf3c942394 50ac7e51_9f94_e985_bfec_ae95273b23b0["isInNodeModules"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 50ac7e51_9f94_e985_bfec_ae95273b23b0 2aff86e8_0c9d_22cb_6536_c1321e1aaa1d["isObject"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 2aff86e8_0c9d_22cb_6536_c1321e1aaa1d 908e9e35_950f_ad37_ffa9_0058622aa7e8["isOptimizable"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 908e9e35_950f_ad37_ffa9_0058622aa7e8 26e0aa25_abdb_a755_dedb_61e78323162d["moduleListContains"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 26e0aa25_abdb_a755_dedb_61e78323162d a4adb1a7_cf54_091f_eb63_8217e684a8e1["normalizePath"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> a4adb1a7_cf54_091f_eb63_8217e684a8e1 3b8df068_35d0_2c94_3ad1_e93c93d1d613["pluginContainer.ts"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 3b8df068_35d0_2c94_3ad1_e93c93d1d613 285b1044_dd20_6f59_7cf5_0ad094eeacee["EnvironmentPluginContainer"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 285b1044_dd20_6f59_7cf5_0ad094eeacee 1abc446c_e46b_1be0_59f5_51bdfded0f6c["createEnvironmentPluginContainer"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd --> 1abc446c_e46b_1be0_59f5_51bdfded0f6c style 6c7a7f5e_5d30_3576_49bf_9041362fd3fd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import fs from 'node:fs'
import fsp from 'node:fs/promises'
import path from 'node:path'
import { performance } from 'node:perf_hooks'
import { scan, transformSync } from 'rolldown/experimental'
import type { PartialResolvedId, Plugin } from 'rolldown'
import colors from 'picocolors'
import { glob } from 'tinyglobby'
import {
CSS_LANGS_RE,
JS_TYPES_RE,
KNOWN_ASSET_TYPES,
SPECIAL_QUERY_RE,
} from '../constants'
import {
arraify,
asyncFlatten,
createDebugger,
dataUrlRE,
deepClone,
externalRE,
isInNodeModules,
isObject,
isOptimizable,
moduleListContains,
multilineCommentsRE,
normalizePath,
singlelineCommentsRE,
virtualModulePrefix,
virtualModuleRE,
} from '../utils'
import type { EnvironmentPluginContainer } from '../server/pluginContainer'
import { createEnvironmentPluginContainer } from '../server/pluginContainer'
import { BaseEnvironment } from '../baseEnvironment'
import type { DevEnvironment } from '../server/environment'
import { transformGlobImport } from '../plugins/importMetaGlob'
import { cleanUrl } from '../../shared/utils'
import { getRollupJsxPresets } from '../plugins/oxc'
export class ScanEnvironment extends BaseEnvironment {
mode = 'scan' as const
get pluginContainer(): EnvironmentPluginContainer {
if (!this._pluginContainer)
throw new Error(
`${this.name} environment.pluginContainer called before initialized`,
)
return this._pluginContainer
}
/**
* @internal
*/
_pluginContainer: EnvironmentPluginContainer | undefined
async init(): Promise<void> {
if (this._initiated) {
return
}
this._initiated = true
this._pluginContainer = await createEnvironmentPluginContainer(
// ... (701 more lines)
Domain
Subdomains
Functions
Classes
Types
Dependencies
- BaseEnvironment
- DevEnvironment
- EnvironmentPluginContainer
- arraify
- asyncFlatten
- baseEnvironment.ts
- cleanUrl
- constants.ts
- createDebugger
- createEnvironmentPluginContainer
- deepClone
- environment.ts
- experimental
- getRollupJsxPresets
- importMetaGlob.ts
- isInNodeModules
- isObject
- isOptimizable
- moduleListContains
- node:fs
- node:path
- node:perf_hooks
- normalizePath
- oxc.ts
- picocolors
- pluginContainer.ts
- promises
- rolldown
- tinyglobby
- transformGlobImport
- utils.ts
- utils.ts
Imported By
Source
Frequently Asked Questions
What does scan.ts do?
scan.ts is a source file in the vite codebase, written in typescript. It belongs to the DependencyOptimizer domain, Scanner subdomain.
What functions are defined in scan.ts?
scan.ts defines 10 function(s): computeEntries, devToScanEnvironment, extractImportPaths, globEntries, isScannable, orderedDependencies, prepareRolldownScanner, rolldownScanPlugin, scanImports, shouldExternalizeDep.
What does scan.ts depend on?
scan.ts imports 32 module(s): BaseEnvironment, DevEnvironment, EnvironmentPluginContainer, arraify, asyncFlatten, baseEnvironment.ts, cleanUrl, constants.ts, and 24 more.
What files import scan.ts?
scan.ts is imported by 4 file(s): environment.ts, index.ts, optimizer.ts, scan.spec.ts.
Where is scan.ts in the architecture?
scan.ts is located at packages/vite/src/node/optimizer/scan.ts (domain: DependencyOptimizer, subdomain: Scanner, directory: packages/vite/src/node/optimizer).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free