NuxtN
Nuxt9mo ago
5 replies
Isu

nuxthub How to use separated env for local/stage/live

As now I have runtime config
    runtimeConfig: {
        // @ts-ignore
        backendKey: env.NUXT_LYS_WEARHOUSE_KEY || '',
        rackbeatApiToken: env.NUXT_RACKBEAT_API_TOKEN || '',
        qzTrayCert: process.env.QZ_TRAY_CERT,
        qzTrayKey: process.env.QZ_TRAY_KEY,

        public: {
            env: process.env.NODE_ENV || 'development',
            apiBase: env.NUXT_PUBLIC_API_BASE || '',
            rackbeatApiBase: env.NUXT_RB_API_URL || '',
            cargonizerApiBase: env.NUXT_CARGONIZER_API_URL || '',
            tripletexApiBase: env.NUXT_API_URL || '',
        }
    },

But during deploy it reads all things from my local .env file, it skips the envs set in nuxthub. I understand usage for
NUXT_PUBLIC_
but how to work with live/stage/local in that case?
What prefix to use for non public ?
Was this page helpful?