Runtime variables with Vue CLI

Docker and Vue.js

When building an distributable version of a project, it should be relatively easy to swap out some variables at runtime. The benefit of this is that you can build the code once and then deploy it across your stack without the need to rebuild. There’s nothing more frustrating than building for test and then having to rebuild for production – it technically means you’re playing a guessing game as to whether what worked and was signed off, will actually work next time around! Vue CLI doesn’t cope with this concept very well. Recently, we have been using nuxt.js and there has been an introduction of runtimeConfig as a concept in their nuxt.config.js file. This is a new release as of v2.13 and works very well. There were workarounds before, but this is the next level of easy environment swapping. To […]