ensureSourceDetectionRootExists() — tailwindcss Function Reference
Architecture documentation for the ensureSourceDetectionRootExists() function in compile.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 7461f1cc_bdcd_4e05_0645_fdba36a9565b["ensureSourceDetectionRootExists()"] 86cbca6b_bfa0_804c_ee2e_2cc7a7aef7fe["compile.ts"] 7461f1cc_bdcd_4e05_0645_fdba36a9565b -->|defined in| 86cbca6b_bfa0_804c_ee2e_2cc7a7aef7fe 1efe0d4f_1301_f69f_5800_360f3b78ddf5["compileAst()"] 1efe0d4f_1301_f69f_5800_360f3b78ddf5 -->|calls| 7461f1cc_bdcd_4e05_0645_fdba36a9565b d357b59a_0b9f_aa27_15e3_243121d6420c["compile()"] d357b59a_0b9f_aa27_15e3_243121d6420c -->|calls| 7461f1cc_bdcd_4e05_0645_fdba36a9565b style 7461f1cc_bdcd_4e05_0645_fdba36a9565b 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
Defined In
Called By
Source
Frequently Asked Questions
What does ensureSourceDetectionRootExists() do?
ensureSourceDetectionRootExists() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-node/src/compile.ts.
Where is ensureSourceDetectionRootExists() defined?
ensureSourceDetectionRootExists() is defined in packages/@tailwindcss-node/src/compile.ts at line 66.
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