I have a functioning vue-cli application that I can easily build. However, I now need to create a single deployable build that can be used on multiple servers. The challenge is that depending on the server, I will need to adjust some basic variables such as server port and API token.
Running multiple builds based on different .env files is not a feasible solution due to the nature of the context in which I work. I often receive settings information on site and need to quickly configure them.
Prior to working with Webpack and its compilation process, I used a traditional JS file for storing settings and would like to replicate something similar. As far as I know, files stored in the public
folder cannot be accessed from Vue components using imports and once minified, adjusting settings becomes even more challenging.
Is there a way to instruct vue-cli3 or webpack to keep a specific file or folder unchanged? Alternatively, is there a cleaner solution that could be implemented?