Replies: 1 comment
-
Not sure how your css framework is close to tailwind-like css utility approach, but you might find something useful here:
The basic approach during dev is:
|
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
-
👋 Hey folks! I was hoping I could crowdsource some help hooking a custom CSS compiler into Vite's plugin API.
Essentially what's happening is that we have a CSS compiler that scans for attributes across all of our TypeScript files, at which point it writes a compressed, prefixed CSS file. I'm hoping I can see if anyone has any experience with this specific sort of task chaining during Vite's build.
The pseudo-logic behind the way I'd expect this to work is:
buildStart
(this works as-is right now)I've done something similar using Eleventy's build process in the past, and I was hoping this might just be a matter of finding the right hook, but so far I've had no luck.
Couple of things to note:
watchChange
hook, but Vite sees the CSS file being written and queues up another build, which rewrites the CSS file, which queues another build, and so on.The simplest iteration of our attempts looks like this:
If there was a way to tell Vite to ignore watching the output CSS file but still bundle it, that would theoretically solve the problem of the infinite loop, but from my tests excluding the file through
chokidar
's settings also removes it from the bundle.Thanks in advance!
Edit: I found what seems to be a temporary solution to this problem by leveraging our existing compiler's
watch
command inside of Vite'sbuildStart
hook rather than running a single build instance on Vite's file detection.Beta Was this translation helpful? Give feedback.
All reactions