diff --git a/Plugins/TailwindCSS/TailwindCSSBuildPlugin.swift b/Plugins/TailwindCSS/TailwindCSSBuildPlugin.swift index a1263cf..d13cd10 100644 --- a/Plugins/TailwindCSS/TailwindCSSBuildPlugin.swift +++ b/Plugins/TailwindCSS/TailwindCSSBuildPlugin.swift @@ -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() } diff --git a/README.md b/README.md index c9254a1..f37554c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ Place your Tailwind CSS entrypoint file at `Tailwind.css` in your target. To int ```css @import "tailwindcss" source(none); -@source "./Views"; +/* Note that as of writing, Tailwind doesn't scan .swift files by default, so you need to specify a glob pattern including the extension. */ +@source "./Views/**/*.swift"; @source "./Template.swift"; @source "./Static"; ``` diff --git a/Sources/SwiftTailwindExample/Folder/Template.swift b/Sources/SwiftTailwindExample/Folder/Template.swift new file mode 100644 index 0000000..61a9db7 --- /dev/null +++ b/Sources/SwiftTailwindExample/Folder/Template.swift @@ -0,0 +1,4 @@ +let template = +""" +