Fork me on GitHub

Is there a way to get figwheel-main to live reload your html files?


@U0LK1552A I think the answer is no but I'm not sure. I don't know the codebase well enough to understand what would happen if the CLJS environment that Figwheel is using were to be reloaded (which is what would happen when the page reloads). If you wanted to try, I think the simplest way would be to edit one of the functions that either watches for CLJS file changes or watches for CSS file changes. If you look at those functions, you see that they have options that specify the file suffixes to watch. At the moment, these are CLJS and JS files (in the case of the watch-dirs) and CSS files (in the case of css-dirs). So if you change the suffixes listed here (, then if you pass the directory with your HTML files as a watch-dirs option, it should reload, I think. Remember that when you set the watch-dirs option, you also need to manually specify src or wherever you have your CLJS.


@U0LK1552A Posted a reply that might point you where to go.


Actually, on closer inspection, I'm not sure this would work. The functions involved in reloading the CLJS, will try to evaluate the files which is not what you want. The functions involved in CSS reloading look to update the DOM. I think if you wanted this functionality, you'd probably need to create a new watch process that works similar to the CSS reloading but reloads the entire page.

👍 1

@UG9H141FX ah thanks that is a detailed explanation! Makes sense to me. It’s not too hard to just reload in this situation at least. I was just curious more than anything. But it makes sense it’s a bit complicated


eg. the public index.html


The CSS support is probably worth looking at


Well css reloading is fine. And there is an option for it. Don’t see one for html files. Maybe could just put them in that watch-dir setting and it may work


I meant to look at the implementation for it


It had some clues when I looked at it


@dominicm ah yes, reading through some of it, haven’t went that far yet