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
  53f8c5ca_9d70_37ce_3501_1b2ac9315393["getContextFromCache()"]
  4d87ade3_79e3_f749_8b40_7a0e8f43b9dc["index.ts"]
  53f8c5ca_9d70_37ce_3501_1b2ac9315393 -->|defined in| 4d87ade3_79e3_f749_8b40_7a0e8f43b9dc
  7e4891ad_b5c5_f083_e9e1_3dc43422517d["tailwindcss()"]
  7e4891ad_b5c5_f083_e9e1_3dc43422517d -->|calls| 53f8c5ca_9d70_37ce_3501_1b2ac9315393
  style 53f8c5ca_9d70_37ce_3501_1b2ac9315393 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
}

Subdomains

Called By

Frequently Asked Questions

What does getContextFromCache() do?
getContextFromCache() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-postcss/src/index.ts.
Where is getContextFromCache() defined?
getContextFromCache() is defined in packages/@tailwindcss-postcss/src/index.ts at line 32.
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