I want to separate development and production environment variables for my shadow-cljs which is running in conjunction with a lein app through the Luminus template. My production environment is a docker container running on heroku. It should work in a way that I can import a map, say config, and so that I can access the keys using (:some-key config), or something similar to this.
0
votes
1 Answers
0
votes
There is built-in support for separating release and dev configuration.
https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration
The "import a map and access by key" you are asking for is not supported by shadow-cljs and would be something a library would provide instead.
I also do not recommend using environment variables to configure a build.
Also note that shadow-cljs configuration is about build time. If you want to access the "environment" at runtime you do not make it part of the build at all. Say you create a :node-script
build running in node
. You can just access js/process.env.SOME_ENV
at runtime via normal code.