Open existe-deja opened 10 months ago
Hi @existe-deja.
In fact, TwicPics Nuxt3 module already uses runTimeConfig.
This is the plugin.js used in our Nuxt3 module:
Now, in a Nuxt3 project we configure the module like this:
(with a default config)
And then we can add an .env file to our project like this:
NUXT_PUBLIC_TWICPICS_DOMAIN="https://demo.twic.it"
NUXT_PUBLIC_TWICPICS_ANTICIPATION=50
NUXT_PUBLIC_TWICPICS_STEP=100
We we run the project
we actually use the domain as configured in the .env
file.
But I don't think that's meets your needs. In fact, if you modify the .env
file, you'll have to redo a Nuxt dev (or build) so that the modifications are taken into account.
To be honest, I don't see how you can modify your environment variables once the project has been built.
Could you clarify this for me so that we can take a closer look?
Looking forward to reading you.
Miguel
Hi, thanks for your answer. I can use the NUXT_PUBLIC_TWICPICS_DOMAIN
env variable and it works fine even after a build. Thing is twicpics nuxt3 module require a domain
option even if i set one in the with the env variable.
Can you make it optional?
Hi,
It would be nice to support runtime configuration instead of build only. I manage a project with a staging domain and I have to build it separately to handle different domains.
edit: I use the nuxt 3 component module