Home / Function/ run() — tailwindcss Function Reference

run() — tailwindcss Function Reference

Architecture documentation for the run() function in at-import.test.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  3bd0a797_6dde_5feb_e059_8147dc714584["run()"]
  92803c39_c941_b81a_faed_4d1bb8805726["run()"]
  3bd0a797_6dde_5feb_e059_8147dc714584 -->|calls| 92803c39_c941_b81a_faed_4d1bb8805726
  38bfe51e_e2b6_fcde_5ec2_9e78b758e748["compile()"]
  3bd0a797_6dde_5feb_e059_8147dc714584 -->|calls| 38bfe51e_e2b6_fcde_5ec2_9e78b758e748
  ea66dbcb_b7c1_4a25_1f66_4e479030f442["optimizeCss()"]
  3bd0a797_6dde_5feb_e059_8147dc714584 -->|calls| ea66dbcb_b7c1_4a25_1f66_4e479030f442
  style 3bd0a797_6dde_5feb_e059_8147dc714584 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/at-import.test.ts lines 10–34

async function run(
  css: string,
  {
    loadStylesheet = () => Promise.reject(new Error('Unexpected stylesheet')),
    loadModule = () => Promise.reject(new Error('Unexpected module')),
    candidates = [],
    optimize = true,
  }: {
    loadStylesheet?: (
      id: string,
      base: string,
    ) => Promise<{ content: string; base: string; path: string }>
    loadModule?: (
      id: string,
      base: string,
      resourceHint: 'plugin' | 'config',
    ) => Promise<{ module: Config | Plugin; base: string; path: string }>
    candidates?: string[]
    optimize?: boolean
  },
) {
  let compiler = await compile(css, { base: '/root', loadStylesheet, loadModule })
  let result = compiler.build(candidates)
  return optimize ? optimizeCss(result) : result
}

Domain

Subdomains

Frequently Asked Questions

What does run() do?
run() is a function in the tailwindcss codebase.
What does run() call?
run() calls 3 function(s): compile, optimizeCss, run.

Analyze Your Own Codebase

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

Try Supermodel Free