Banyan now uses Tailwind 3.0 to build the CSS, both in live server and during static site generation. This does add nodeJS as our dev dependencuy, but on the plus side we get all the cool new features of Tailwind (like print:hidden
).
node’s concurrently
is a decent package that mimics Procfile
.
"scripts": {
"dev": "concurrently npm:banyan:*",
"banyan:tailwind": "cd tailwind && make",
"banyan:haskell": "bin/run-haskell"
}
I use this to spawn both ghcid
and tailwindcss
watcher in the same process, with output interleaved. Though concurrently
seems to have trouble with actually shutting down ghcid. I have to manually kill a stale ghcid spawned process to make the port available.
Keeping generated CSS in source control.
So banyan user will not have to be running Tailwind watcher. For apps like Emanote we want the user to be able to do this, though. But other Ema apps don’t need to. So there are two models here:
- Dev-time Tailwind watcher
- Run-time Tailwind watcher
No. 1 is simpler to implement, and should be sufficient for most Ema apps. But Emanote will need No. 2, which also brings in a long-running nodeJS process into user’s machine.
Initial prototype for this is working well. Just need to run tailwindcss watcher in separate terminal, and the model static file “versioning” trick picks up the Tailwind’s artifact, albeit with a slight delay, which is acceptable.