Fork me on GitHub
#boot
<
2017-10-20
>
mudphone04:10:35

I’m attempting to set up multiple js file outputs from boot. I’m using a main.cljs.edn file and would like to add another other.cljs.edn file with a different require. I’m assuming I need to set a different asset-path in other.cljs.edn… but I’m getting js errors from goog.

GET  net::ERR_ABORTED
(anonymous) @ other.js:3
Is there an example project I can take a look at where someone is doing this?

mudphone08:10:39

So, the cljs boot task’s :ids refers to the .edn file in resources?

mudphone08:10:20

Interesting, I had no idea one could do that.

mudphone08:10:27

Thank you for your assistance!

yury.solovyov09:10:29

To be fair, this approach has at least 1 downside I can think of - code common for both ids is not extracted into common file. This could be possible by using :modules, but it is advanced feature and some tooling it not yet ready for it

yury.solovyov09:10:53

just so you know

yury.solovyov09:10:49

In my case, ids will barely have anything common so it is acceptable for me

mudphone22:10:33

Ah, that’s good to know. I had read about :modules, but haven’t seen it used yet. I think I would be okay with not extracting common code for now.

mudphone23:10:32

BTW, your Eion project looks cool!

yury.solovyov07:10:03

@mudphone you need different :output-to's

bmaddy20:10:35

Does anyone know of a simple way to serve up the cljs files in the out directory via a webserver in development? I'm sure I could set up compojure or something, but I'm wondering if there's a quick and easy way to do it with something like boot-jetty. I ask because I need to serve them to my client so I can use cljs.js/eval-str (which wants to be able to load source files). Once deployed, this would all live statically on S3. (I'm still wrapping my head around boot if you can't tell)

yury.solovyov20:10:45

Take a look at boot-http

yury.solovyov21:10:55

See the serve call

bmaddy21:10:51

Ahh, that might do what I need--thanks @yury.solovyov!