ClojureScript

build api fails to generate inline code for :target :nodejs

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.76
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

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

Activity

Hide
Bruce Hauman added a comment -

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

Show
Bruce Hauman added a comment - 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
Hide
Dusan Maliarik added a comment -

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

Show
Dusan Maliarik added a comment - Would anyone from the team please look at the patch? Thank you
Hide
David Nolen added a comment -

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

Show
David Nolen added a comment - Please attach a patch to the ticket for review. Linking out of JIRA is not desirable. Thanks.

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated: