Fork me on GitHub
#boot
<
2016-10-20
>
upgradingdave15:10:59

Hi all, I’m sure this is something easy, but can’t seem to find it - how can I tell boot to create actual files? For example, if I do (cljs :optimizations :advanced), it compiles successfully and makes the js files available to other tasks like serve, but I don’t see the js file anywhere on disk? How can I tell boot to write the actual compiled js file to disk?

upgradingdave15:10:38

maybe the sift task is the way to go? maybe sift it into a resources/public directory or something like that?

anmonteiro15:10:24

e.g.: (boot (cljs :optimizations :advanced) (target))

upgradingdave15:10:46

ah, sweet, perfect, thanks!

anmonteiro15:10:14

@upgradingdave you can also customize the directory where the files will end up with (target :dir “foo")

anmonteiro15:10:22

the default being “target"

anmonteiro19:10:51

can I call e.g. sift inside with-pre-wrap?

anmonteiro19:10:37

if not, how do I remove a file from the fileset?

martinklepsch19:10:25

@anmonteiro the fileset is a map/record with a :tree key. Keys are paths and values are describing files at that path. Dissoc a key to remove a file

martinklepsch19:10:43

(make sure you also commit! the changed fileset value)

anmonteiro19:10:52

seems simple enough

anmonteiro19:10:26

@martinklepsch hrm, would this be possible?

(deftask foo []
  (comp (with-pre-wrap fileset ….)
    (sift ...)))

anmonteiro19:10:48

with-pre-wrap generates a function AFAIK

anmonteiro19:10:57

also a viable option then, thanks

martinklepsch19:10:20

you're welcome 🙂

anmonteiro19:10:06

shouldn’t find a file in the classpath for me?

anmonteiro19:10:12

boot.core/by-re should be able to do what I want

micha20:10:14

io/resource will find a file on the classpath

micha20:10:51

the by-re function filters a collection of TmpFile objects though, not classpath

micha20:10:59

it's for filtering the fileset