Fork me on GitHub
#figwheel-main
<
2019-10-21
>
ingesol05:10:16

Any hints on how to prevent duplication in compiler configs? We have a comprehensive list of :foreign-libs, which needs to be duplicated in our dev, prod and test configs. I tried using the (experimental) :npm config that generates the foreign libs, but couldn’t get it working. Is there any way to reuse parts of config between builds? Using leiningen.

ingesol06:10:40

Underlying problem being that things like :preloads and :closure-defines should be different between builds. Is there a way to override with command line params?

paulbutcher13:10:09

I have a re-frame app, running on Electron and compiled using Figwheel Main. Everything works fine (really well, in fact) but I’m getting errors in the Javascript console about Figwheel not being able to load react:

[Figwheel REPL] Figwheel: Error loading file /Users/paul/Personal/opentrack/resources/node/renderer/cljsjs/react-dom/development/react-dom.inc.js
[Figwheel REPL] Error: Cannot find module 'react'
[Figwheel REPL] Error loading file ../cljsjs/react-dom/development/react-dom.inc.js
Certainly react is being loaded (because the app runs fine). Any ideas what might be causing the above errors? And what (if anything) I should be worried about?

🙌 1
paulbutcher12:11:38

To answer my own question - the warnings weren’t about the inability to load react - they were about the inability to load the cljsjs react shims. The solution was to exclude them from the build as follows:

reagent {:mvn/version "0.9.0-rc1" :exclusions [cljsjs/react cljsjs/react-dom]}