This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
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.
if it makes npm install preact into the node_modules/react
folder then shadow-cljs will just use that
when you require react
shadow-cljs looks in node_modules/react
and uses whatever is there
it never checks the package.json in your project itself, only whatever is in node_modules
https://docs.npmjs.com/cli/v8/commands/npm-install#description
then search for npm:
prefix
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.
I've ended up using goog-define
https://cljs.github.io/api/compiler-options/closure-defines
With --config-merge
https://shadow-cljs.github.io/docs/UsersGuide.html#config-merge