This feature you are talking about (in the case of the web.config) is called Xml Transform. Unfortunately, Visual Studio only has support to transform web.config files automatically and nothing else.
SlowCheetah was created to transform other xml files of your choice, but it only works for Xml files. You can configure it to transform the files on each build (via a custom msbuild task) for instance.
I'm not aware of any solutions to transform javascript files though.
EDIT:
Perhaps you could build your own HttpHandler
class to serve the customized js file? The link to the js file on the page would point to it, and it would serve a different js file for each customer, and the switching logic would be in the server.
I still feel this is a poor solution (but I may be biased because of Web Forms), and that ideally you would generate the page with this information already set, that is, the configuration could be in the web.config file for instance, and the controller on the server side could use the settings to personalize the page.
EDIT 2:
Ok. Based on the last comments I now understand that this is static configuration, i.e., it is deployment specific, and does not change based on a user on the same website for instance. Considering that, I feel this should not be part of the build process, but of deployment.
I would seriously consider using a deployment tool to customize the files based on target environment. Microsoft's own Release Management can achieve that relatively easily using the built-in workflow activities. In the release pipeline, you could pick the javascript file you want, based on any parameter you pass to the workflow.