My answer maybe covers a bit more than what you asked initially, but bear with me.
Yes, it is possible to have different config files for different environments.
Vue Storefront uses this package to compile the different configuration files into a single file: https://github.com/lorenwest/node-config
In my current project we have split the configuration into these files:
default.json (the file bundled with VSF with the default content)
shared.json (all the project specific configuration that should be identical in all environments)
docker.json (used by developers when developing within the bundled Docker image)
gitlab.json (used within Gitlab CI pipelines)
We are using an environment variable to tell which config files should be loaded besides
default.json, and in which order. Check the docs for the environment variables here: https://github.com/lorenwest/node-config/wiki/Environment-Variables
For example in our Docker environment configuration we have added this line:
This means, that three config files will be loaded:
docker.json. In this order.
We have filled in the file contents so that the more specific files contain only the configuration entries that need to be overridden from the more generic file. So
shared.json has less content than
docker.json has less content than
It is of course project specific, where and how exactly you should define the
NODE_CONFIG_ENV. So for this I cannot give an exact answer.
The location of the final configuration file is
core/build/config.json. Verify the results from that file after compiling the configuration. (IIRC, it gets done within
yarn build in production mode, and in development mode it gets compiled every time you start the server).