Home / Function/ getPreloadType() — vue Function Reference

getPreloadType() — vue Function Reference

Architecture documentation for the getPreloadType() function in index.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  d6067825_113a_583c_13c4_07c0380b4928["getPreloadType()"]
  d6a44bc7_6475_aed8_c9a0_e12eb3350db5["normalizeFile()"]
  d6a44bc7_6475_aed8_c9a0_e12eb3350db5 -->|calls| d6067825_113a_583c_13c4_07c0380b4928
  style d6067825_113a_583c_13c4_07c0380b4928 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/template-renderer/index.ts lines 293–306

function getPreloadType(ext: string): string {
  if (ext === 'js') {
    return 'script'
  } else if (ext === 'css') {
    return 'style'
  } else if (/jpe?g|png|svg|gif|webp|ico/.test(ext)) {
    return 'image'
  } else if (/woff2?|ttf|otf|eot/.test(ext)) {
    return 'font'
  } else {
    // not exhausting all possibilities here, but above covers common cases
    return ''
  }
}

Subdomains

Called By

Frequently Asked Questions

What does getPreloadType() do?
getPreloadType() is a function in the vue codebase.
What calls getPreloadType()?
getPreloadType() is called by 1 function(s): normalizeFile.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free