Fork me on GitHub

Hi, does anyone have an example of Figwheel Main on Nodejs with some external deps like e.g. Express? I got the very basic stuff working like repl in Cider but using Node deps eludes me so far and the webpack + npm tutorial seems a little complicated.


Btw. I'm using Linux and nvm for node and seems I have to specify node-command though ts in my path


Also Cider suggests a config like :dev but obviously they are named just dev, test et by the template. It also gives a very confusing error message


I can see if there is something I can contribute to these two.


Is it possible to configure compiler options for lein fig:min? I want to add an externs.js file.

eccentric J17:01:35

@grumplet My understanding is that <build-id>.cljs.edn files, such as dev.cljs.edn are where you put compiler options.


@jayzawrotny Thanks - will try.

Karol Wójcik19:01:03

I’m trying to use npm-deps feature but I fail. Is there some tutorial or blog which describes the process of integrating 3rd party library based on react?

^{:watch-dirs ["test" "src"]
  :css-dirs ["resources/public/css"]
  :auto-testing true}
{:main some-example.core
 :npm-deps {"react-text-loop" "2.0.1"}
 :verbose true
 :install-deps true}
As I can see cljs_deps.js does not contain the dependency react-text-loop but cljs$node_modules.js does.


Let me know if you have any questions

Karol Wójcik19:01:38

Seems very self explanatory to me 😄

👍 5
Karol Wójcik19:01:13

Does it work perfectly fine with the advanced compilation?


sure, look at output of this repo (in readme of this repo)


of course it is not optimised in the same way as clourescript is


but there is no way to do it better AFAIK

Karol Wójcik19:01:38

Seems legit to me! Thank you very much!

🍻 5

BTW I will appreciate feedback about this module (look at master branch) 😉 I did it, but I have issue about make it popular, because I am not famous 😛


It is more useful for people as example of fighweel-main, than for what was my intention trollface

Karol Wójcik19:01:49

Got a one question. about this one. What if rum requires react? Doesn’t the compilation will include react both times?

Karol Wójcik19:01:21

you excluded cljsjs/react and react-dom

Karol Wójcik19:01:25

You’re smart guy!

eccentric J22:01:48

@kwladyka I’m looking at your form-validator repo for your recommendation on handling npm deps. So you need to run npm add xyz and npm install before building it will work right?