computeEntries() — vite Function Reference
Architecture documentation for the computeEntries() function in scan.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD 6e6d9ef8_8985_1977_b0ea_4f37e4502554["computeEntries()"] 6c7a7f5e_5d30_3576_49bf_9041362fd3fd["scan.ts"] 6e6d9ef8_8985_1977_b0ea_4f37e4502554 -->|defined in| 6c7a7f5e_5d30_3576_49bf_9041362fd3fd ca966b07_32a3_9d37_9eca_d2ebd25f7f76["scanImports()"] ca966b07_32a3_9d37_9eca_d2ebd25f7f76 -->|calls| 6e6d9ef8_8985_1977_b0ea_4f37e4502554 36c11b2d_1259_3d70_ff60_f67bf5a9ac52["globEntries()"] 6e6d9ef8_8985_1977_b0ea_4f37e4502554 -->|calls| 36c11b2d_1259_3d70_ff60_f67bf5a9ac52 2aff86e8_0c9d_22cb_6536_c1321e1aaa1d["isObject()"] 6e6d9ef8_8985_1977_b0ea_4f37e4502554 -->|calls| 2aff86e8_0c9d_22cb_6536_c1321e1aaa1d cb488b23_3da2_8fce_842d_98fe1fe4a384["isScannable()"] 6e6d9ef8_8985_1977_b0ea_4f37e4502554 -->|calls| cb488b23_3da2_8fce_842d_98fe1fe4a384 acb05845_9984_6792_9aae_b58486b613b5["resolveId()"] 6e6d9ef8_8985_1977_b0ea_4f37e4502554 -->|calls| acb05845_9984_6792_9aae_b58486b613b5 style 6e6d9ef8_8985_1977_b0ea_4f37e4502554 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/optimizer/scan.ts lines 193–243
async function computeEntries(environment: ScanEnvironment) {
let entries: string[] = []
const explicitEntryPatterns = environment.config.optimizeDeps.entries
const buildInput = environment.config.build.rollupOptions.input
if (explicitEntryPatterns) {
entries = await globEntries(explicitEntryPatterns, environment)
} else if (buildInput) {
const resolvePath = async (p: string) => {
// rollup resolves the input from process.cwd()
const id = (
await environment.pluginContainer.resolveId(
p,
path.join(process.cwd(), '*'),
{
isEntry: true,
scan: true,
},
)
)?.id
if (id === undefined) {
throw new Error(
`failed to resolve rollupOptions.input value: ${JSON.stringify(p)}.`,
)
}
return id
}
if (typeof buildInput === 'string') {
entries = [await resolvePath(buildInput)]
} else if (Array.isArray(buildInput)) {
entries = await Promise.all(buildInput.map(resolvePath))
} else if (isObject(buildInput)) {
entries = await Promise.all(Object.values(buildInput).map(resolvePath))
} else {
throw new Error('invalid rollupOptions.input value.')
}
} else {
entries = await globEntries('**/*.html', environment)
}
// Non-supported entry file types and virtual files should not be scanned for
// dependencies.
entries = entries.filter(
(entry) =>
isScannable(entry, environment.config.optimizeDeps.extensions) &&
fs.existsSync(entry),
)
return entries
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does computeEntries() do?
computeEntries() is a function in the vite codebase, defined in packages/vite/src/node/optimizer/scan.ts.
Where is computeEntries() defined?
computeEntries() is defined in packages/vite/src/node/optimizer/scan.ts at line 193.
What does computeEntries() call?
computeEntries() calls 4 function(s): globEntries, isObject, isScannable, resolveId.
What calls computeEntries()?
computeEntries() is called by 1 function(s): scanImports.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free