I'd love to know the "correct" answer to this too, but in the meantime, here's how I've been doing it:
I define the "release" version in some namespace. To use it, I require this namespace. Eg release-namespace/func Then I create a separate file for the debug build and I require the release namespace and overwrite the function (remember, they're compiled to normal javascript variables): (defn debug-func ...) (set! release-namespace/func debug-func) Finally, in my project.clj (or profile.clj), I add the debug file to the :source-paths in the debug build settings. Though I haven't tried it, I believe you can do something similar in normal clojure using alter-var-root. On 3 April 2014 16:06, t x <txrev...@gmail.com> wrote: > The correct statement should be: "I *no longer* use cljx." :-) > > On Thu, Apr 3, 2014 at 8:05 AM, t x <txrev...@gmail.com> wrote: > > I don't use cljx. It slows down "lein cljsbuild auto." > > > > I'm using pure clojurescript. Is there a way to get the "dev" / > > "release" tag passed somehow? > > > > On Thu, Apr 3, 2014 at 6:58 AM, Alex Robbins > > <alexander.j.robb...@gmail.com> wrote: > >> If you used cljx, you could probably use the feature expressions to do > what > >> you want. > >> > >> https://github.com/lynaghk/cljx > >> > >> You'd need to set up a custom rule for it, but it seems well within the > >> scope of the project. > >> > >> > >> On Thu, Apr 3, 2014 at 8:50 AM, t x <txrev...@gmail.com> wrote: > >>> > >>> Hi, > >>> > >>> I'm trying to figure out how to do the following: > >>> > >>> Have a shared cljs/* ... > >>> > >>> For the "dev" build, have (debug ...) compile to (js/console.log ...) > >>> > >>> For the "release" build, have (debug ...) compile to (do). > >>> > >>> Basically, I want different things to happen depending on whether > >>> the build is dev or release. > >>> > >>> Does anyone have an example of how to do this? > >>> > >>> Thanks! > >>> > >>> -- > >>> You received this message because you are subscribed to the Google > >>> Groups "Clojure" group. > >>> To post to this group, send email to clojure@googlegroups.com > >>> Note that posts from new members are moderated - please be patient with > >>> your first post. > >>> To unsubscribe from this group, send email to > >>> clojure+unsubscr...@googlegroups.com > >>> For more options, visit this group at > >>> http://groups.google.com/group/clojure?hl=en > >>> --- > >>> You received this message because you are subscribed to the Google > Groups > >>> "Clojure" group. > >>> To unsubscribe from this group and stop receiving emails from it, send > an > >>> email to clojure+unsubscr...@googlegroups.com. > >>> For more options, visit https://groups.google.com/d/optout. > >> > >> > >> -- > >> You received this message because you are subscribed to the Google > >> Groups "Clojure" group. > >> To post to this group, send email to clojure@googlegroups.com > >> Note that posts from new members are moderated - please be patient with > your > >> first post. > >> To unsubscribe from this group, send email to > >> clojure+unsubscr...@googlegroups.com > >> For more options, visit this group at > >> http://groups.google.com/group/clojure?hl=en > >> --- > >> You received this message because you are subscribed to the Google > Groups > >> "Clojure" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an > >> email to clojure+unsubscr...@googlegroups.com. > >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.