Fork me on GitHub
#figwheel-main
<
2020-08-20
>
grumplet16:08:20

@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.

grumplet16:08:15

These are set in test.cljs.edn to

grumplet16:08:47

: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

grumplet16:08:10

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

grumplet16:08:06

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

grumplet16:08:39

The apparent cacheing issue was nothing to do with cacheing.

grumplet16:08:50

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.

grumplet16:08:13

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

pez16:08:21

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

pez16:08:46

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

grumplet16:08:21

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

pez17:08:03

Oh, yes. Super helpful!