constructor() — vite Function Reference
Architecture documentation for the constructor() function in mixedModuleGraph.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD 3acdf189_b419_0a41_c750_a3225ac83e3d["constructor()"] c1a5c030_6aae_0cbb_cc67_256559724512["ModuleGraph"] 3acdf189_b419_0a41_c750_a3225ac83e3d -->|defined in| c1a5c030_6aae_0cbb_cc67_256559724512 9a9dc712_60c4_c65b_885b_6bcb790c15f2["constructor()"] 9a9dc712_60c4_c65b_885b_6bcb790c15f2 -->|calls| 3acdf189_b419_0a41_c750_a3225ac83e3d 9a9dc712_60c4_c65b_885b_6bcb790c15f2["constructor()"] 3acdf189_b419_0a41_c750_a3225ac83e3d -->|calls| 9a9dc712_60c4_c65b_885b_6bcb790c15f2 57bd050c_f162_f6af_9491_3a9b3bcd5ca2["set()"] 3acdf189_b419_0a41_c750_a3225ac83e3d -->|calls| 57bd050c_f162_f6af_9491_3a9b3bcd5ca2 88fceafc_7ebe_4d67_4956_00f98b9b651d["createBackwardCompatibleModuleMap()"] 3acdf189_b419_0a41_c750_a3225ac83e3d -->|calls| 88fceafc_7ebe_4d67_4956_00f98b9b651d f69e7359_4c92_c290_7870_d78b5ebc9060["createBackwardCompatibleFileToModulesMap()"] 3acdf189_b419_0a41_c750_a3225ac83e3d -->|calls| f69e7359_4c92_c290_7870_d78b5ebc9060 style 3acdf189_b419_0a41_c750_a3225ac83e3d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/server/mixedModuleGraph.ts lines 277–315
constructor(moduleGraphs: {
client: () => EnvironmentModuleGraph
ssr: () => EnvironmentModuleGraph
}) {
this._moduleGraphs = moduleGraphs
const getModuleMapUnion =
(prop: 'urlToModuleMap' | 'idToModuleMap') => () => {
// A good approximation to the previous logic that returned the union of
// the importedModules and importers from both the browser and server
if (this._ssr[prop].size === 0) {
return this._client[prop]
}
const map = new Map(this._client[prop])
for (const [key, module] of this._ssr[prop]) {
if (!map.has(key)) {
map.set(key, module)
}
}
return map
}
this.urlToModuleMap = createBackwardCompatibleModuleMap(
this,
'urlToModuleMap',
getModuleMapUnion('urlToModuleMap'),
)
this.idToModuleMap = createBackwardCompatibleModuleMap(
this,
'idToModuleMap',
getModuleMapUnion('idToModuleMap'),
)
this.etagToModuleMap = createBackwardCompatibleModuleMap(
this,
'etagToModuleMap',
() => this._client.etagToModuleMap,
)
this.fileToModulesMap = createBackwardCompatibleFileToModulesMap(this)
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does constructor() do?
constructor() is a function in the vite codebase, defined in packages/vite/src/node/server/mixedModuleGraph.ts.
Where is constructor() defined?
constructor() is defined in packages/vite/src/node/server/mixedModuleGraph.ts at line 277.
What does constructor() call?
constructor() calls 4 function(s): constructor, createBackwardCompatibleFileToModulesMap, createBackwardCompatibleModuleMap, set.
What calls constructor()?
constructor() is called by 1 function(s): constructor.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free