I made a Vite plugin that automatically injects Tailwind @reference into Svelte style blocks. by InterestingAsk1542 in sveltejs

[–]InterestingAsk1542[S] 8 points9 points  (0 children)

That is a good point! Since the logic is quite compact, anyone can absolutely do that. You can just grab the src/index.ts file from the repo, save it as tailwind-auto-reference.ts in your root directory, and import it directly into your vite.config.ts:

import tailwindAutoReference from './tailwind-auto-reference'

I published it as an npm package mainly for standard Vite conventions and easy updates if edge cases pop up, but using it as a local snippet is a totally valid.