nuxt-i18n exposing config to __NUXT__
Is it possible to prevent exposing the whole configuration? It exposes translation files full paths also, it's insecure
I'm using SSG mode in nuxt3 with nuxt-i18n module
2 Replies
Hi @dschewchenko. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I apologize, but I don't have enough information in the provided knowledge sources to answer your specific question about nuxt-i18n and preventing the exposure of configuration in SSG mode with Nuxt 3. The documents provided don't contain information about nuxt-i18n or its configuration exposure.
However, I can provide some general information about runtime configuration in Nuxt 3 that might be relevant:
Nuxt 3 uses the
runtimeConfig
option in the nuxt.config.ts
file to manage configuration and environment variables. This system is designed to handle sensitive information more securely. As explained in the Nuxt documentation (https://nuxt.com/docs/guide/going-further/runtime-config#environment-variables):
1. Only values defined in runtimeConfig
are exposed to your application.
2. Values in runtimeConfig
(outside of the public
key) are only available server-side.
3. Values in runtimeConfig.public
are available both client-side and server-side.
If you're concerned about exposing sensitive information, you should ensure that it's not placed in the public
section of runtimeConfig
. However, for your specific case with nuxt-i18n, you would need to consult the nuxt-i18n documentation or seek further assistance from the Nuxt or nuxt-i18n community.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@766311960705892352> Kapa.ai is still learning and improving, please let me know how I did by reacting below.