In order to handle [this] nicely then, I need to be able to specify things which are specific to bash or zsh in their own files, and then to specify things which any POSIX-compliant shell (like aliases and environment variables) can understand in a common startup file.
Check https://blog.flowblok.id.au/2013-02/shell-startup-scripts.html (https://bitbucket.org/flowblok/shell-startup/)