Fork me on GitHub
#cljs-dev
<
2020-04-22
>
Niclas15:04:23

I’m using lein-cljsbuild in a large project and compilation times are becoming noticeably long, do you guys have any good guides on compilator speedup techniques?

dnolen15:04:39

@looveh need more details - dev builds, advanced builds?

Niclas15:04:30

@dnolen This would be the config passed to cljsbuild

{:builds [{:id             "dev"
           :figwheel       true
           :source-paths   ["src"]
           :compiler       {:output-to "app/target/dev/index.js"
           :main           "env.main"
           :parallel-build true
           :output-dir     "app/target/dev"
           :optimizations  :none}}]}

dnolen15:04:12

@looveh are you blowing away the target directory every time?

dnolen15:04:22

nothing is going to get faster if everything must be recompiled

Niclas15:04:55

I would assume figwheel doesn’t since compile times may vary depending on which file is being edited

dnolen15:04:56

@looveh if you only change one file that it should not take a long time to recompile

dnolen15:04:12

you can add :verbose true to see what's going on

Niclas15:04:05

@dnolen Thanks, I’ll check that out. Not sure if it’s figwheel that’s recompiling all the children in the dependency tree of the file I’m editing, unless I’m editing any macros it should only be the single file that would need recompiling if I’m thinking right about this?

dnolen15:04:59

it's not generally safe to not recompile dependents

dnolen15:04:13

you will lose warnings - but if you're feeling brave you can control this

Niclas15:04:56

@dnolen Awesome, thanks. Feeling brave today