I try to inject runtime variable in my vue3 project and it seems it's not possible. All variables are injected at builtime. What i want to to is to do one build in staging instance, put the assets in a cdn and promote the build in production instance by just changing the path of the assets. I had not found any solution and i'm a bit desperate :( Am i missing something or it's just not like that vue3 works ?
Asked
Active
Viewed 932 times
2
-
1You could have a `config.js` file that contains information about what should happen during runtime. During `setup` of your app, this file is imported and analyzed and the app configures itself according to what is inside this configuration. The vite build is static and only needs to know that there is a config file. After build, you can have several configuration files that lead to different behaviour of the app. – Nechoj Apr 19 '22 at 11:54
-
@Sylvadoc did u find any solution? – coure2011 Jul 25 '22 at 07:19
-
@coure2011it seems i must pass to nuxt3 (https://v3.nuxtjs.org/guide/going-further/runtime-config/). – Sylvadoc Oct 24 '22 at 13:14