This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-02
Channels
- # announcements (2)
- # beginners (69)
- # boot (1)
- # cider (35)
- # clara (1)
- # cljs-dev (1)
- # clojure (40)
- # clojure-spec (11)
- # clojure-uk (8)
- # clojurescript (9)
- # cursive (1)
- # datomic (5)
- # figwheel-main (25)
- # fulcro (64)
- # jobs (2)
- # jukebox (1)
- # kaocha (3)
- # off-topic (7)
- # pathom (39)
- # planck (5)
- # random (1)
- # re-frame (11)
- # reagent (8)
- # shadow-cljs (58)
- # test-check (41)
- # vim (13)
It seems to work with :npm-deps
in dev.cljs.edn but it should be able to use package.json right?
Figured it out. The figwheel-main spec indicates that npm-deps has to be a map or false.
@jayzawrotny I answered you here https://clojurians.slack.com/archives/C03S1L9DN/p1549070241634700
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.
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.
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.
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 🙂
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
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?
Heh only my simple web page http://wladyka.eu which I made years ago 🙂