optimizeAliasReplacementForSSR() — vite Function Reference
Architecture documentation for the optimizeAliasReplacementForSSR() function in preAlias.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD 0eb5ad90_ecd1_8056_eed4_0fc65836b26c["optimizeAliasReplacementForSSR()"] 1ad4458e_b744_979c_c30e_c1021fdd26b7["preAlias.ts"] 0eb5ad90_ecd1_8056_eed4_0fc65836b26c -->|defined in| 1ad4458e_b744_979c_c30e_c1021fdd26b7 200356af_4305_31b8_b090_47f38784e182["preAliasPlugin()"] 200356af_4305_31b8_b090_47f38784e182 -->|calls| 0eb5ad90_ecd1_8056_eed4_0fc65836b26c style 0eb5ad90_ecd1_8056_eed4_0fc65836b26c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/plugins/preAlias.ts lines 87–101
function optimizeAliasReplacementForSSR(
id: string,
optimizeDeps: DepOptimizationOptions,
) {
if (optimizeDeps.include?.includes(id)) {
return true
}
// In the regular resolution, the default for non-external modules is to
// be optimized if they are CJS. Here, we don't have the package id but
// only the replacement file path. We could find the package.json from
// the id and respect the same default in the future.
// Default to not optimize an aliased replacement for now, forcing the
// user to explicitly add it to the ssr.optimizeDeps.include list.
return false
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does optimizeAliasReplacementForSSR() do?
optimizeAliasReplacementForSSR() is a function in the vite codebase, defined in packages/vite/src/node/plugins/preAlias.ts.
Where is optimizeAliasReplacementForSSR() defined?
optimizeAliasReplacementForSSR() is defined in packages/vite/src/node/plugins/preAlias.ts at line 87.
What calls optimizeAliasReplacementForSSR()?
optimizeAliasReplacementForSSR() is called by 1 function(s): preAliasPlugin.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free