Fork me on GitHub
#cljsjs
<
2016-06-26
>
jiangts08:06:03

this is a noob question, but how do you package react components into UMD modules (to be consumed by cljsjs)? I'm having trouble navigating through babel + webpack builds in libraries such as https://github.com/andreypopp/react-fa

jiangts08:06:41

in that repo, they give an example of how to use webpack to package an example app using the library but not the library itself.

juhoteperi08:06:46

@jiangts: That library uses webpack to bundle styles from JSX into CSS bundle etc.

juhoteperi08:06:54

That won't be possible with Cljsjs/Cljs

juhoteperi08:06:25

Or something

juhoteperi08:06:34

I don't really understand why they use Webpack there

juhoteperi08:06:00

Also, the implementation of Icon component is 10 lines in Cljs

jiangts08:06:07

@juhoteperi right -- it was trivial to do in reagent, but in general I'd like to figure out how to package arbitrary react components to use in my project, rather than only be able to use pre-packaged ones

jiangts08:06:50

@juhoteperi: also, is it really impossible? can't we get webpack to emit a UMD js file and a css file and just include those into the html?

jiangts08:06:11

perhaps not really possible to distribute the css in cljsjs, but the js should work right?

juhoteperi10:06:53

I have no idea about UMD modules

juhoteperi10:06:54

Some packages call webpack to build something