Fork me on GitHub
#figwheel-main
<
2019-02-02
>
jaide01:02:47

It seems to work with :npm-deps in dev.cljs.edn but it should be able to use package.json right?

jaide04:02:08

Figured it out. The figwheel-main spec indicates that npm-deps has to be a map or false.

jaide19:02:01

Thanks, I was trying to find this again but was having trouble. I think the nuance I got confused by is your use of webpack, for nodejs scripts it’s :npm-deps or nothing.

kwladyka20:02:01

AFAIK when you use nodejs deps you can require them directly in code without any extra additions. You don’t need webpack. I miss that part of question about nodejs app. Sorry.

jaide20:02:34

No worries. I appreciate the help, it just took a bit for it to finally click as I was confused myself. I was convinced I could keep my deps only in package.json and just use them in cljs but both fighwheel-main and lein-figwheel require the :npm-deps map to use them.

kwladyka20:02:55

hmm I though it can be only in package.json too for nodejs

kwladyka20:02:13

but I didn’t do any nodejs app with figwheel-main, so I don’t know

jaide20:02:57

I tried it, I couldn’t get it to work and the spec of figwheel says npm-deps can only be false or a map of deps. The cljs docs state that if npm-deps is false it completely ignores node_modules anticipating bundling to happen from webpack or something. It’s possible I am misconfiguring it but signs are pointing to an :npm-deps requirement. Worst case I can release a working version when it’s ready and someone can correct me 🙂

kwladyka20:02:17

I am sure bhauman can easy answer you for this question.

kwladyka20:02:37

He is from time to time here

jaide20:02:20

Would you recommend raising an issue on figwheel-main?

kwladyka20:02:19

Hmm I think it is issue about documentation at the first place then

kwladyka20:02:38

because there is no clear answer from what you are saying

kwladyka20:02:58

personally I don’t know what is an answer

kwladyka20:02:24

I found the answer from bhauman from the past to me:

kwladyka20:02:32

bhauman [3:14 PM]
@kwladyka figwheel always needs to start a server for its websocket connection

all you need is `:target :nodejs`
Not sure about Cursive
You shouldn't have to use :npm {:bundles} when you use nodejs (edited) 
You can and should  use `js/require` directly
`:npm-deps true` will in many cases allow you to require node modules in `ns` forms

kwladyka20:02:56

ha I think it solves your issue

kwladyka20:02:44

I saved this precious advice for the future like now 🙂

jaide20:02:13

Hah interesting. I see, I am using ns forms which I think is important to this project. I’m going to make a PR to update the docs to explain that and perhaps write a small article. Thanks so much! Do you have an email, website, or org I can credit?

👍 5
kwladyka20:02:28

Heh only my simple web page http://wladyka.eu which I made years ago 🙂

kwladyka20:02:20

But don’t worry. I am happy I could help you.

kwladyka20:02:38

Clojure community is great, so I am trying to give back what I got 🙂

jaide20:02:55

I completely agree with you 🙂