Fork me on GitHub

Hi, I'm having some trouble with figwheel. I have two files in my src folder which figwheel is set to watch, and one of those files is my :main. The issue is that figwheel only includes the :main in the global javascript file that includes all else (and that we link in the html). How can I fix this?


If I open the browser console I also only see the :main javascript file in my project folder


@ggfpc12495 if I understand you correctly that is how figwheel is supposed to work


but I’d need to now more before I can help you further


So what I mean is that I have two html files for two different pages, index and login. For each one of those I have a cljs file, index.cljs and login.cljs. My :main in the figwheel config is myproject.index. When figwheel loads, both index.cljs and login.cljs are compiled into js, but the myproject-dev.js which is what (as far as I know) needs to be linked in the html files only includes index.js and not login.js so my login page has no javascript


you would need to require the login.js for it to be present @ggfpc12495


Also of interest is the :extra-mains functionality


Oh I see, so a normal workflow If I wanted to have multiple cljs files would have me require all of them in the :main one whether directly or transitively?


to different entry points mean two different builds


so for instance you could have one main file that requires both of your current mains and then decides which one to render based on perhaps some information on the page


that way you would have one build


or you could have to builds ie two .cljs.edn files and then run two instances of figwheel


or you can use extra-mains


Of all these the first suggestion of having a single main that requires your two mains and then make a decision which one to render, is the easiest


@daniel975 one good way to debug the production build is to compile to :whitespace not :advanced and then see what the error is


I’d really love to know what problem you are having. I’m probably missing something basic