compile() — tailwindcss Function Reference
Architecture documentation for the compile() function in index.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD c59be670_b950_e897_c2ef_f6a86119dcc3["compile()"] 23bd4e2f_c62c_a942_7014_8486569053ee["index.ts"] c59be670_b950_e897_c2ef_f6a86119dcc3 -->|defined in| 23bd4e2f_c62c_a942_7014_8486569053ee c9124c5e_77f1_5faa_7949_359cfce74aca["run()"] c9124c5e_77f1_5faa_7949_359cfce74aca -->|calls| c59be670_b950_e897_c2ef_f6a86119dcc3 4c9ec9aa_6fa1_c418_ce6a_63ab7fcf8a66["render()"] 4c9ec9aa_6fa1_c418_ce6a_63ab7fcf8a66 -->|calls| c59be670_b950_e897_c2ef_f6a86119dcc3 9d7d664d_b6fd_88fd_8800_4b530c33a95b["parse()"] c59be670_b950_e897_c2ef_f6a86119dcc3 -->|calls| 9d7d664d_b6fd_88fd_8800_4b530c33a95b 95f6fed7_1762_4f0d_f308_50c6be9a770a["compileAst()"] c59be670_b950_e897_c2ef_f6a86119dcc3 -->|calls| 95f6fed7_1762_4f0d_f308_50c6be9a770a 9b49f3c6_0c8d_5c62_965c_30a1db6499f8["toCss()"] c59be670_b950_e897_c2ef_f6a86119dcc3 -->|calls| 9b49f3c6_0c8d_5c62_965c_30a1db6499f8 e55a3745_8aee_a25b_5e76_52ab134693bc["createSourceMap()"] c59be670_b950_e897_c2ef_f6a86119dcc3 -->|calls| e55a3745_8aee_a25b_5e76_52ab134693bc style c59be670_b950_e897_c2ef_f6a86119dcc3 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
Defined In
Source
Frequently Asked Questions
What does compile() do?
compile() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/index.ts.
Where is compile() defined?
compile() is defined in packages/tailwindcss/src/index.ts at line 819.
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