I came up with a decent (?) Solution to this problem after taking bebraw advice - I thought that I would post it as an additional answer if someone is faced with the same problem or wants to implement something similar. I use TypeScript, but the same approach probably works fine in JavaScript with or without ES6.
Basically, now I have a directory called config in my src that contains a subdirectory for each client, for example:
config βββ dev βββ cust1 βββ cust2
Each of them contains an info.ts file that exports constants, such as REST endpoint URLs:
export default { name: "Company Name", server: "http://localhost:8810", service: "ServiceName" }
And the modules.ts file, which exports an array of modules to pass into my load function of the boot application:
import util from "../../modules/util"; import session from "../../modules/session"; import shell from "../../modules/shell"; import stock from "../../modules/stock"; export default [ util, session, shell, stock, ];
They should be separate - my original implementation had one .ts file for each configuration, but that meant that I ran into a cyclical dependency when I tried to import constants from modules.
Then I just added resolve.alias based on the command line argument:
alias: { "config": path.join(__dirname, `src/config/${yargs.argv.env || "dev"}/`) }
Now I can disable that config/info and config/modules refer only to a call:
webpack --env dev webpack --env cust1 webpack --env cust2
I still need to see how it works in practice, and perhaps clarify the interface for different exhibits, but as a starting point I still like it!