Fork me on GitHub
#shadow-cljs
<
2019-10-05
>
papachan01:10:24

i miss something. When i get a look at some shadow-cljs.edn file i dont see any clojurescript version or dependence. i understand shadow-cljs use webpack. but it dont need any clojurescript api to compile clojure code?

thheller10:10:16

shadow-cljs does not use webpack

thheller10:10:38

the shadow-cljs version is controlled by whichever version you have installed in your package.json

thheller10:10:02

and it has a default clojurescript dependency to ensure you are using a compatible version and not some 5 year old release or so

thheller10:10:51

so basically the :dependencies listed in shadow-cljs.edn have [thheller/shadow-cljs "..."] added automatically

papachan12:10:22

Cool Thomas thank for your explanation. I was wondering which magic was running with shadow-cljs

papachan12:10:56

so shadow-cljsforce dev to use the latest clojurescript version

rberger02:10:32

How does one include css from node packages so its available to my app? Is there a better way than just copying it manually from the node_modules/<package>/dist/css into resources/public/css and adding it to my index.html as an asset?

thheller10:10:40

@rberger you can use any tool you like to process css. I personally mostly use node-sass but just copying might be enough as well

rberger18:10:00

I don't need to process the CSS. I'm incorporating a HOC from the AWS Amplify Javascript package. I get the JS no problem with the very nice node import features of shadow-cljs. But wondering if there is an equally elegant way to incorporate the associated CSS. The manual process works, but I'm just wondering if there are other conventions or mechanisms of pulling in the CSS from node packages.

rberger18:10:10

On a related note, I did get AWS Amplify Authentication integrated very nicely with re-frame using shadow-cljs. I did have to manually copy in the CSS from the AWS Amplify UI dist from the node_modules https://github.com/omnyway-labs/re-frame-re-com-amplify-shadow-cljs

rberger18:10:57

Heh, funny the include picked CSS as the language

thheller18:10:00

with node-sass I typically have a main.scss that includes all the other stuff I want. so @import "node_modules/foo/bar.css"

thheller18:10:10

node-sass will then compile and minify everything together

rberger18:10:38

Ah, ok, I'll look into that. I'm pretty new to the modern JS / node environment. Thanks!

thheller18:10:58

a regular Makefile will do 😉

rberger18:10:53

I included garden just because it was in the re-frame scaffolding. Makefiles!

dazld17:10:32

if you’d like an example of using a makefile to build shadow and sass, here’s one: https://github.com/dazld/shadow-cljs-sass/blob/master/resources/leiningen/new/shadow_cljs_sass/Makefile