Fork me on GitHub
#shadow-cljs
<
2023-07-30
>
hifumi12310:07:54

Suppose I decide to declare react as npm:@preact/compat in my package.json. Shadow seems to support this, as requiring react gives me preact. Is this incidental? I cannot come up with a good reason to recommend :js-options :resolve over this method.

thheller11:07:55

> Suppose I decide to declare react as npm:@preact/compat in my package.json.

thheller11:07:03

I literally do not know what this means or does 😛

thheller11:07:26

if it makes npm install preact into the node_modules/react folder then shadow-cljs will just use that

thheller11:07:54

when you require react shadow-cljs looks in node_modules/react and uses whatever is there

thheller11:07:18

it never checks the package.json in your project itself, only whatever is in node_modules

hifumi12319:07:23

Apprently its a way to alias dependencies into different npm packages

thheller05:07:59

ah, didn't know that was a thing

thheller05:07:08

:resolve still seems like a safer bet though

👍 2
nikolavojicic13:07:00

What is the preferred way to pass some variables (or configuration map) during app release and use values of those variables in code? E.g. provide context path of the backend. Ideally I would have localhost as default and override it for prod, dev etc. I saw -config--merge in docs but I'm not sure how to access that config from code.