Fork me on GitHub
#figwheel-main
<
2020-03-09
>
pyrmont00:03:19

@dmarjenburgh: It's a few days past but I recently set up a Gulp workflow that sounds very similar to what @pez described. Here's my gulpfile.js with the tasks I define (https://github.com/pyrmont/pondent/blob/master/gulpfile.js). I'm using Tailwind in that project but you could adapt it pretty easily for any other CSS framework that has a PostCSS plugin. In development, it will start a watch on the directory with your CSS pieces and then gracefully end that watch when you quit Figwheel! :)

pez06:03:23

That's cool! In my case I haven't tried spawning them together like that. I have the watcher running in some terminal and start/stop figwheel independently. It probably depends a lot on the rest of your project and workflow, which method to choose.

pyrmont06:03:19

I confess setting it up like this was purely so I had less to type and so I got the neat little summary at the end saying how long the process had been running :P

pyrmont06:03:57

It does have the disadvantage of having CSS rebuild messages appearing in amongst Figwheel's output.

pez06:03:26

That’s sometimes an advantage. 😎

dmarjenburgh07:03:38

Thanks for the tips. It seems it's quite normal then to have your figwheel project be an npm project as well, similar to shadow-cljs.

pez07:03:44

It might already be clear, but anyway, in my case only the css job is an npm project. Figwheel knows nothing about this, it only reacts on the css files coming out of it. My workflow is that I start this npm project in watch mode and then go Figwheeling. While I quite often do something to the Figwheel project that makes me need to restart it, the css watcher just keeps chugging on. I think right now it might have been running for 80 days straight. 😃 It has the disadvantage that I sometimes forget about starting it when I restart my computer, and spend some time wondering why Figwheel isn't hot reloading my css changes (.scss in my case).

😄 4