Fork me on GitHub
#figwheel-main
<
2018-08-19
>
euccastro09:08:16

how do I --build-once programmatically? the docs for the API seem focused on starting REPLs and servers, but what I want is to just compile a production .js in the middle of a deployment script

euccastro09:08:09

I looked into the figwheel-main sources but I was perplexed; I found it hard to follow, perhaps because I'm not familiar with the workings of cljs.main itself

euccastro09:08:44

well, I guess I could always do (figwheel.main/-main "--build-once" "prod"), but since there's an API namespace I don't suppose that's how I'm supposed to do it

euccastro09:08:47

also, do I need target in my classpath for --build-once? I thought it was only required for :optimizations :none?

euccastro09:08:52

I'm asking because I get the following warning:

[email protected]:~/src/semente$ clj -A:dev:deploy -m figwheel.main -bo prod
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid!
[Figwheel:WARNING] Attempting to dynamically add "target" to classpath!
[Figwheel:WARNING] Target directory "target" is not on the classpath
[Figwheel:WARNING] Please fix this by adding "target" to your classpath

bhauman10:08:54

@euccastro these are both good questions

bhauman10:08:11

It’s fine to use (figwheel.main/-main "--build-once" "prod")

bhauman10:08:36

for now because build once isn’t really available through the api

bhauman10:08:42

it should be

bhauman10:08:33

and yes :target shouldn’t be validated during a build once build