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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user