renderPreloadLinks() — vue Function Reference
Architecture documentation for the renderPreloadLinks() function in index.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 48f78087_f8f3_e196_d371_cd23f6e72848["renderPreloadLinks()"] 6267c156_f90f_17b7_4f37_300535e21f45["TemplateRenderer"] 48f78087_f8f3_e196_d371_cd23f6e72848 -->|defined in| 6267c156_f90f_17b7_4f37_300535e21f45 7c7d334f_3782_7894_ca93_084f14d54628["renderResourceHints()"] 7c7d334f_3782_7894_ca93_084f14d54628 -->|calls| 48f78087_f8f3_e196_d371_cd23f6e72848 ab85e43a_7e1f_51d8_5aae_6749fe8b8c37["getPreloadFiles()"] 48f78087_f8f3_e196_d371_cd23f6e72848 -->|calls| ab85e43a_7e1f_51d8_5aae_6749fe8b8c37 style 48f78087_f8f3_e196_d371_cd23f6e72848 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/server-renderer/src/template-renderer/index.ts lines 176–202
renderPreloadLinks(context: Object): string {
const files = this.getPreloadFiles(context)
const shouldPreload = this.options.shouldPreload
if (files.length) {
return files
.map(({ file, extension, fileWithoutQuery, asType }) => {
let extra = ''
// by default, we only preload scripts or css
if (!shouldPreload && asType !== 'script' && asType !== 'style') {
return ''
}
// user wants to explicitly control what to preload
if (shouldPreload && !shouldPreload(fileWithoutQuery, asType)) {
return ''
}
if (asType === 'font') {
extra = ` type="font/${extension}" crossorigin`
}
return `<link rel="preload" href="${this.publicPath}${file}"${
asType !== '' ? ` as="${asType}"` : ''
}${extra}>`
})
.join('')
} else {
return ''
}
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does renderPreloadLinks() do?
renderPreloadLinks() is a function in the vue codebase, defined in packages/server-renderer/src/template-renderer/index.ts.
Where is renderPreloadLinks() defined?
renderPreloadLinks() is defined in packages/server-renderer/src/template-renderer/index.ts at line 176.
What does renderPreloadLinks() call?
renderPreloadLinks() calls 1 function(s): getPreloadFiles.
What calls renderPreloadLinks()?
renderPreloadLinks() is called by 1 function(s): renderResourceHints.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free