'Loading vue config at runtime

My wish is, that I can build a vue package and install it on any server just by changing the config without recompiling.

My problem:
I don't know how to fetch it.
I use axios for my backend communication at the moment, but I don't know how to download something without knowing the hostname.

I think an ideal solution would be to include a script that contains the config, similar to how the image tag works. The script should not be minified or included.

But I didn't find a source of anyone doing that (where it worked).

Has anyone a solution for that.

PS: I found this question, but the hostname problem still remains.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source