Fork me on GitHub
#cljs-dev
<
2020-06-06
>
didibus06:06:01

If I add a npm-deps map to my package, it works as expected. When my package doesn't have npm-deps in its config, but it depends on a package that does I get that error. And as soon as I add some npm-deps in my current package, it all works as expected. And I pulled down ClojureScript at commit for v1.10.773 and if I change this:

(merge
       {:hashbang      false
        :infer-externs true
        :nodejs-rt     false
        :target        :nodejs}
       (when-not (:npm-deps opts)
         {:npm-deps true}))
to this:
(merge
       {:hashbang      false
        :infer-externs true
        :nodejs-rt     false
        :target        :nodejs}
       (when-not (:npm-deps opts)
         {:npm-deps {}}))
It fixes it. If I change it back to true, I get the error again. On a quick glance, this seems like a safe change, everything else in closure.clj seems to assume npm-deps will be a map, except for one (not (false? npm-deps)) check, but this will work as well in this case, since it is explicit about checking for not false? instead of true?. It also means this is now redundant:
(defn check-npm-deps [{:keys [npm-deps]}]
  (let [npm-deps (if (true? npm-deps) {} npm-deps)

baptiste-from-paris18:06:31

Hello friends, I was looking at clojurescript code base and I was wondering why cljs compiler does not use clojure.tools.analyzer as it uses tools.reader. Thanks a lot