-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(config): break ui.config.ts
into separate files
#930
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
@ineshbose I haven't forgotten this but it's quite tricky to merge this as it will break all existing PRs. Also, is this really the solution? There should be a better way to exclude unused components from the tailwind config automatically. |
This isn't going to be the proper solution, but it is a step towards reaching it. Content detection in Tailwind is not automated right now, so just like Lines 158 to 162 in ceb2ed3
we're going to have to consume them all. However, we most certainly do need to break the files down on a component-level if we are to make progress on this. When this is merged, users will at least have the option to specify the component files they don't use like so: import { resolve } from 'pathe'
export default {
content: [
'!' + resolve('node_modules/@nuxt/ui/dist/runtime/ui.config/data/table.mjs'),
'!' + resolve('node_modules/@nuxt/ui/dist/runtime/ui.config/forms/radioGroup.mjs'),
]
} without this, all styles are in a singular file, so we either include it, or exclude it or do this similar approach above but in a complex way by creating an extractor function (not ideal). All said, what would be really great for the next step of this PR, would be using (Happy to continue discussion over Discord btw π) |
I'm gonna make a release in the coming days, do you think it would be best to count this in? |
@benjamincanac I understand your point about breaking existing PRs, though we can also argue that implementing this change sooner for contributors to build upon would be better. I see 11 open |
You make a good point, let's merge this then! Would you mind fixing the conflicts? If you have any doubt on what changed I can take care of it no worries π |
ui.config.ts
into separate files
OK that's done. Ready to merge. @benjamincanac π |
π Linked issue
makes progress on #877
β Type of change
π Description
While work on reducing bundle size automatically will continue, this is part of the foundation for it.
This will also provide a workaround for devs to exclude the files for components not being used as Tailwind's content configuration reads entire files.
π Checklist