figwheel-main

figwheel-main http://figwheel.org
grumplet 2020-08-20T16:30:20.002900Z

@folcon @dominicm Yes it works now. I don’t have a lot to report as in the end I just worked through the figwheel-main testing docs which do apply equally well when :target is set to :bundle. The main gotcha is the :output-to and :final-output-to settings.

grumplet 2020-08-20T16:32:15.003500Z

These are set in test.cljs.edn to

grumplet 2020-08-20T16:32:47.004Z

:final-output-to "resources/public/cljs-out/test/main_bundle.js"
 :bundle-cmd {:none ["npx" "webpack" "--mode=development" :output-to "-o" :final-output-to]};
and I have

grumplet 2020-08-20T16:33:10.004600Z

:target-dir "resources"
in figwheel-main.edn

grumplet 2020-08-20T16:34:06.005500Z

But it’s easiest to check you are generating sane output paths with the -pc switch.

grumplet 2020-08-20T16:34:39.006200Z

The apparent cacheing issue was nothing to do with cacheing.

grumplet 2020-08-20T16:38:50.010500Z

I was using Calva jack-in in vscode, and there are a couple of subtleties there as mentioned above. You must generate a final webpack main_bundle.js before using a calva jack-in repl as calva will not proceed to make the webpack bundle. The neat thing is that once you have a webpack main-bundle it will work with the calva jack-in outputs so long as you haven’t added new scripts. So follow the figwheel docs to generate the bundle, and then you switch to a jack-in repl for nice inline evaluation.

grumplet 2020-08-20T16:42:13.011400Z

There may be a way to persuade calva to run the npx webpack command after jack in - I haven’t investigated that.

pez 2020-08-20T16:55:21.012700Z

There might be a way to persuade the Calva team, at least. 😎

pez 2020-08-20T16:56:46.014Z

@grumplet would you consider writing some doc page for http://calva.io about the ways to currently work with this?

grumplet 2020-08-20T16:58:21.014500Z

Sure - I could try and put something together if it’s helpful.

pez 2020-08-20T17:22:03.015500Z

Oh, yes. Super helpful!