compile() — tailwindcss Function Reference
Architecture documentation for the compile() function in index.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 214d4226_762c_0b6a_7c0b_f917da98dda0["compile()"] e93dda94_b9d2_6d76_fb27_e3cf07eea5b1["run()"] e93dda94_b9d2_6d76_fb27_e3cf07eea5b1 -->|calls| 214d4226_762c_0b6a_7c0b_f917da98dda0 811a05d1_74b6_db8d_9c62_35b3ec21cf16["render()"] 811a05d1_74b6_db8d_9c62_35b3ec21cf16 -->|calls| 214d4226_762c_0b6a_7c0b_f917da98dda0 257c4715_dc91_0c7f_fce8_433a757d9ce6["parse()"] 214d4226_762c_0b6a_7c0b_f917da98dda0 -->|calls| 257c4715_dc91_0c7f_fce8_433a757d9ce6 6a3a8ab4_d53c_7516_c736_663c060fe979["compileAst()"] 214d4226_762c_0b6a_7c0b_f917da98dda0 -->|calls| 6a3a8ab4_d53c_7516_c736_663c060fe979 af90c185_29a2_6c4c_ef06_b18f00f7655c["toCss()"] 214d4226_762c_0b6a_7c0b_f917da98dda0 -->|calls| af90c185_29a2_6c4c_ef06_b18f00f7655c 47a467ce_1274_79db_8183_51a8ee266f23["createSourceMap()"] 214d4226_762c_0b6a_7c0b_f917da98dda0 -->|calls| 47a467ce_1274_79db_8183_51a8ee266f23 style 214d4226_762c_0b6a_7c0b_f917da98dda0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/index.ts lines 819–855
export async function compile(
css: string,
opts: CompileOptions = {},
): Promise<{
sources: { base: string; pattern: string; negated: boolean }[]
root: Root
features: Features
build(candidates: string[]): string
buildSourceMap(): DecodedSourceMap
}> {
let ast = CSS.parse(css, { from: opts.from })
let api = await compileAst(ast, opts)
let compiledAst = ast
let compiledCss = css
return {
...api,
build(newCandidates) {
let newAst = api.build(newCandidates)
if (newAst === compiledAst) {
return compiledCss
}
compiledCss = toCss(newAst, !!opts.from)
compiledAst = newAst
return compiledCss
},
buildSourceMap() {
return createSourceMap({
ast: compiledAst,
})
},
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does compile() do?
compile() is a function in the tailwindcss codebase.
What does compile() call?
compile() calls 4 function(s): compileAst, createSourceMap, parse, toCss.
What calls compile()?
compile() is called by 2 function(s): render, run.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free