This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-20
Channels
- # announcements (7)
- # babashka (16)
- # beginners (58)
- # boot (12)
- # calva (3)
- # cider (11)
- # clj-kondo (9)
- # cljs-dev (8)
- # clojure (82)
- # clojure-europe (9)
- # clojure-italy (11)
- # clojure-losangeles (1)
- # clojure-nl (8)
- # clojure-uk (8)
- # clojurescript (5)
- # css (2)
- # cursive (5)
- # datomic (20)
- # docker (2)
- # emacs (4)
- # figwheel-main (16)
- # fulcro (53)
- # graalvm (17)
- # jackdaw (2)
- # jobs (4)
- # kaocha (6)
- # lambdaisland (2)
- # luminus (2)
- # meander (1)
- # off-topic (146)
- # re-frame (4)
- # releases (1)
- # rum (12)
- # sci (71)
- # shadow-cljs (26)
- # test-check (22)
- # vim (1)
- # xtdb (9)
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
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 https://figwheel.org/docs/extra_mains.html
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?
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
or you could have to builds ie two .cljs.edn files and then run two instances of figwheel
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