Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
when inline code is provided as vector to the composition of `cljs.build.api/build` and `cljs.build.api/inputs` methods under `:target :nodejs`  the provided inline code is not output.


;; this outputs code
(cljs.build.api/build (cljs.build.api/inputs '[(ns hello.core) (+ 1 2)]) {})

;; this does not output inline code
(cljs.build.api/build (cljs.build.api/inputs '[(ns hello.core) (+ 1 2)]) {:target :nodejs})


;; When you don't use cljs.build.api/inputs everything works correctly
(cljs.build.api/build '[(ns hello.core) (+ 1 2)] {}) ;; this outputs code

(cljs.build.api/build '[(ns hello.core) (+ 1 2)] {:target :nodejs}) ;; this outputs code

4 Answers

0 votes
by

Comment made by: bhauman

From @ykomatsu on Github:

add-preloads seems to remove cljs/nodejs.cljs.

https://github.com/clojure/clojurescript/blob/ab7a4911f1fd3a81210b1a9f2d84857748f8268b/src/main/clojure/cljs/closure.clj#L897

This patch will fix this problem but I am not sure if this is correct solution.

https://github.com/ykomatsu/clojurescript/commit/fc986467e66e6a628dc8f0e8a2ef2b30f715fd23

0 votes
by

Comment made by: skrat

Would anyone from the team please look at the patch? Thank you

0 votes
by

Comment made by: dnolen

Please attach a patch to the ticket for review. Linking out of JIRA is not desirable. Thanks.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-1806 (reported by bhauman)
...