Replies: 1 comment
-
You wouldn't instruct Tailwind to do that via your plugin. If the components are in separate files, you'd add file globs that only cover the files used in the /** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./node_modules/my-tw-plugin/blue-button.svelte',
],
// …
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
say i am building my own component package that uses svelte for JS and tailwind classes for styling
say the package is called
my-tw-plugin
so i add this plugin to my tailwind config:
how would i get tailwind to only purge classes from components that are actually used in the project?
for example, let's say my package has a
BlueButton
component:``js
return (
{children}
)
now, let's also say that my package also has 500 other components, all with their own classes etc.
of course, in my final build i do not want to have the classes for all 500 components, that might be huge. i would only want the css for the
BlueButton
component in the final build, because that is the only component actually used in the projecthow do i instruct tailwind to do this via my plugin? i can't seem to find anything about this in the docs or online
Beta Was this translation helpful? Give feedback.
All reactions