Fork me on GitHub
#shadow-cljs
<
2022-09-06
>
naxels16:09:16

Could someone tell me how I can find out in which env I am working from within the browser target?

naxels16:09:36

I’m trying to set an external API url in Dev that is different in Production

naxels16:09:13

in the docs I can’t really find what I’m looking for, except set additional environment variables, which I don’t think I need since the browser can tell i’m in Dev mode

naxels16:09:43

(as in, it’s acting differently when I’m in dev mode vs accessing the site in production)

naxels17:09:28

Thanks @thheller , i was actually looking at those, but don't understand why I need to declare additional data

naxels17:09:47

Isn't there some data point i can request that tells me which env is loaded?

naxels17:09:19

Like in Rails, all you do is type Rails.env and you get a string with the env back

naxels17:09:18

Given that the :dev env is loaded through VSCode Calva, I was wondering if I can get that as a datapoint?

thheller17:09:23

there is nothing like that in cljs.core by default

thheller17:09:40

well I guess there is goog.DEBUG which is true for dev builds

naxels17:09:50

that would be useful, thanks!

naxels17:09:22

yeah, that works 🙂