Fork me on GitHub

Anyone used :npm-deps ? trying to use three.js but it does not appear to work for me


{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
        org.clojure/clojurescript {:mvn/version "1.10.773"}
        rum {:mvn/version "0.12.3"}
        cljsjs/three {:mvn/version "0.1.01-1"}
        doughamil/threeagent {:mvn/version "0.0.6"}
        com.bhauman/figwheel-main {:mvn/version "0.2.11"}
 :npm-deps {:three "0.120.1"}}
I thought all i needed todo was add :npm-deps to my deps.edn but the details on this are a bit sparse 😕

Alex Miller (Clojure team)13:09:00

that doesn't go in deps.edn


I will try that, never created a build.edn file before usually create figwheel-main.edn dev.cljs.edn and deps.edn for a project will look into it and see if that works


build.edn looks very similar to my dev.cljs.edn file I noticed does one have precedent over the other or is it one or the other


@oliver.marks you have Three as a dep in your deps.edn, you don't shouldn't need :npm-deps if you have that already


That was my first stab, it all stems from doughamil/threeagent which fails because three.js does not exists it has suggestions for lein and shadow-clj but as I am using neither I am looking for a way to make it available


been using native clojurescripts libraries and I have noticed a tendency for others to use shadow-clj when it comes to npm

Oliver George23:09:07

Looking for some :target :bundle help

Oliver George23:09:15

% webpack --progress resources/public/js/index.js -o resources/public/js/app.js
92% chunk asset optimization TerserPlugin

Oliver George23:09:28

Takes about 10 mins on my laptop!

Oliver George23:09:03

If I use the TerserPlugin and set compress: false it improves to a few seconds.

Oliver George23:09:30

Presumably caused by chewing on the advanced build output.

Oliver George23:09:53

Are there recommended webpack settings to avoid pointless "compress the compressed file" slowness?

Oliver George23:09:01

(or I might be guessing at the wrong cause)