ensureSourceDetectionRootExists() — tailwindcss Function Reference
Architecture documentation for the ensureSourceDetectionRootExists() function in compile.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 046d4182_1181_6bdc_f5a1_e865fc7afdb6["ensureSourceDetectionRootExists()"] 548ee7dc_209a_7b48_3113_0f485b3a6152["compileAst()"] 548ee7dc_209a_7b48_3113_0f485b3a6152 -->|calls| 046d4182_1181_6bdc_f5a1_e865fc7afdb6 1f83fc7f_b81f_b901_0d0a_48b6bff9e7fa["compile()"] 1f83fc7f_b81f_b901_0d0a_48b6bff9e7fa -->|calls| 046d4182_1181_6bdc_f5a1_e865fc7afdb6 style 046d4182_1181_6bdc_f5a1_e865fc7afdb6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/@tailwindcss-node/src/compile.ts lines 66–92
async function ensureSourceDetectionRootExists(compiler: {
root: Awaited<ReturnType<typeof compile>>['root']
}) {
// Verify if the `source(…)` path exists (until the glob pattern starts)
if (compiler.root && compiler.root !== 'none') {
let globSymbols = /[*{]/
let basePath = []
for (let segment of compiler.root.pattern.split('/')) {
if (globSymbols.test(segment)) {
break
}
basePath.push(segment)
}
let exists = await fsPromises
.stat(path.resolve(compiler.root.base, basePath.join('/')))
.then((stat) => stat.isDirectory())
.catch(() => false)
if (!exists) {
throw new Error(
`The \`source(${compiler.root.pattern})\` does not exist or is not a directory.`,
)
}
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does ensureSourceDetectionRootExists() do?
ensureSourceDetectionRootExists() is a function in the tailwindcss codebase.
What calls ensureSourceDetectionRootExists()?
ensureSourceDetectionRootExists() is called by 2 function(s): compile, compileAst.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free