fix(styles): stop scanning every component for utility sources

Component discovery is not utility-source discovery: scanning all
built-in and plugin component directories made Tailwind/Iconify generate
rules for components the app never renders. Packages that need scanning
opt in through styles.source.

Pre-existing working-tree change, committed as-is rather than authored
here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 19:16:53 +05:30
co-authored by Claude Opus 5
parent 52cce2c628
commit 10421465df
2 changed files with 11 additions and 8 deletions
+8 -4
View File
@@ -620,10 +620,14 @@ export async function runBuild(appRoot: string): Promise<void> {
appDir,
appRoot: root,
mode: "production",
sources: [
...componentDirs,
...pluginContributions.styles.flatMap((style) => (style.source ? [style.source] : [])),
],
// Component discovery is not style discovery. Built-in and plugin
// components own their CSS; scanning every available component makes
// Tailwind/Iconify generate rules for packages and components the app
// never renders. Packages that intentionally use app utilities opt in
// through an explicit styles.source contribution.
sources: pluginContributions.styles.flatMap((style) =>
style.source ? [style.source] : [],
),
entries: pluginContributions.styles.flatMap((style) => (style.entry ? [style.entry] : [])),
},
config.styles,