Fork me on GitHub
#cljs-dev
<
2017-11-27
>
levitanong19:11:51

Hi all, is there any plan to support allowing a user to pass a custom output-wrapper? https://github.com/clojure/clojurescript/blob/e83cf518ef4d3d6aa9a1cca18dc889efb0eae57f/src/clj/cljs/closure.clj#L862 I’m getting some errors during advanced optimization which would be best addressed by passing in a custom string,

'(function(){\n%output%\n}).call(window)'
to allow the closure to have access to some other context. In this case, I wish to use window to get access to the global scope.

dnolen20:11:18

@levitanong :output-wrapper could easily support function values, feel free to submit a minor enhancement patch

dnolen20:11:46

I would check JIRA to match sure there isn’t a dupe for this enhancement

levitanong20:11:37

@dnolen on it. Looks like there isn’t a pre-existing ticket for this, given a search for “output-wrapper”.

levitanong22:11:23

@dnolen attached the patch. https://dev.clojure.org/jira/browse/CLJS-2423 I was given the option to set the patch to either code or code + test, but I opted not to choose any because I thought I would be able to change later when I actually had a patch to show for it. I don’t know how to change it. 😅

dnolen22:11:05

no worries, will sort that out

levitanong22:11:19

my pleasure!