PureScript tooling will not bundle env variables in anyway. If you are writing a node app, and you have access to a “real” env, then you can read it with node-process. Otherwise, I’d probably recommend having separate spago.dhall files for production and dev, and including different sources. There’s also probably a way to include ad-hoc file paths as a command line argument for the build.
While you can read different spago.dhall file which you can pass by --config. you end up with 2 different dependencies list, which I don’t like. I tried to take it out from spago.dhall file but that didn’t work.
However I end-up with this solution.
in my sources I have:
This way if I don’t pass environment variable, I call Config module from .env.dev.purs.
and if I pass PRODUCTION=True (note the uppercase), then I get .env.purs Config module. :))
My .env.purs and .env.dev.purs have the same name of the module and I import it as Config.
Anything you want to share you could put in a different file and import, but I think the env conditional you are using is better. I didn’t know you could do that with Dhall!