Fork me on GitHub
Yehonathan Sharvit13:07:20

Hello there, is there a way with shadow-cljs to compile a cljs lib into a js bundle for the browser?


@viebel whats the difference to compiling a cljs app?

Yehonathan Sharvit15:07:53

I am not sure. Maybe the fact that there is no entry point


you need to be more precise and describe what exactly "js bundle" means for you. there is always an entry point, even a lib will have at least one ns you'd use

Yehonathan Sharvit15:07:31

A ns could be set as entry point. No need for a specific function?

Yehonathan Sharvit15:07:21

By “js bundle” I mean that if I load this file in the browser, all the function of my lib are defined and callable


defined and callable by what?


the usual ^:export will make everything defined and callable. you can have as many of those in your lib as you want.


I guess I'm confused by the "lib" aspect. not sure what that means to you.

Yehonathan Sharvit15:07:44

The use case is for libs that are not self host compatible, to make them usable in a Klipse snippet

Yehonathan Sharvit15:07:56

I don’t need advanced compilation

Yehonathan Sharvit15:07:18

I don’t want to force lib author to add ^:export to all the lib functions


so you are talking about CLJS libs being used by self-hosted CLJS? that would be a no then.


I mean there is and you could in theory just compile all libs you want to be available together


but other than that there is no support for any other self-hosted stuff and you kinda need to write that yourself