Improve glob handling for source paths and update docs

- Simplify glob handling in TailwindCSSBuildPlugin to support **
patterns - Update README and Tailwind.css example to clarify glob usage
- Add Template.swift example using Tailwind classes - Extend tests to
verify class extraction from globbed Swift files
This commit is contained in:
Shibo Lyu 2025-08-18 15:22:54 +08:00
parent 7c848062ec
commit e23147768d
5 changed files with 15 additions and 3 deletions

View file

@ -65,8 +65,10 @@ struct TailwindCSSBuildPlugin: BuildToolPlugin {
.matches(of: sourceDeclarationRegex)
.compactMap { String($0.output.1) }
let sourceURLs: [URL] = sourcePaths.map { path in
target.directoryURL
.appending(component: path, directoryHint: .inferFromPath)
// Simplified handling: If ** is used, we just include everything in the directory.
let globlessPath = path.replacing(/\*\*.*/, with: "")
return target.directoryURL
.appending(component: globlessPath, directoryHint: .inferFromPath)
.resolvingSymlinksInPath()
}