Home / Function/ getContextFromCache() — tailwindcss Function Reference

getContextFromCache() — tailwindcss Function Reference

Architecture documentation for the getContextFromCache() function in index.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  66a9dec2_54af_10f5_fa1f_a4e5eaba75db["getContextFromCache()"]
  f4282831_f22b_2be1_4c8f_449ba7a9c8d7["tailwindcss()"]
  f4282831_f22b_2be1_4c8f_449ba7a9c8d7 -->|calls| 66a9dec2_54af_10f5_fa1f_a4e5eaba75db
  style 66a9dec2_54af_10f5_fa1f_a4e5eaba75db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-postcss/src/index.ts lines 32–48

function getContextFromCache(postcss: Postcss, inputFile: string, opts: PluginOptions): CacheEntry {
  let key = `${inputFile}:${opts.base ?? ''}:${JSON.stringify(opts.optimize)}`
  if (cache.has(key)) return cache.get(key)!
  let entry = {
    mtimes: new Map<string, number>(),
    compiler: null,
    scanner: null,

    tailwindCssAst: [],
    cachedPostCssAst: postcss.root(),
    optimizedPostCssAst: postcss.root(),

    fullRebuildPaths: [] as string[],
  }
  cache.set(key, entry)
  return entry
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getContextFromCache() do?
getContextFromCache() is a function in the tailwindcss codebase.
What calls getContextFromCache()?
getContextFromCache() is called by 1 function(s): tailwindcss.

Analyze Your Own Codebase

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

Try Supermodel Free