Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop need to specify the runtime config when using .env #239

Open
harlan-zw opened this issue Sep 3, 2024 · 0 comments
Open

Drop need to specify the runtime config when using .env #239

harlan-zw opened this issue Sep 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@harlan-zw
Copy link
Collaborator

🆒 Your use case

I beleive this is a Nuxt edge case for .env, but end user needs to specify an empty key for the .env override to do anything, i.e:

export default defineNuxtConfig({
  scripts: {
    registry: {
      googleAnalytics: true,
    }
  },
  // you need to provide a runtime config to access the environment variables
  runtimeConfig: {
    public: {
      scripts: {
        googleAnalytics: {
          // .env
          // NUXT_PUBLIC_SCRIPTS_GOOGLE_ANALYTICS_ID=<your-id>
          id: '',
        },
      },
    },
  },
})

🆕 The solution you'd like

We should try and see if we can drop the need for this runtimeConfig as it's quite verbose.

🔍 Alternatives you've considered

No response

ℹ️ Additional info

No response

@harlan-zw harlan-zw added the enhancement New feature or request label Sep 3, 2024
@harlan-zw harlan-zw changed the title Drop need to specify the runtime config Drop need to specify the runtime config when using .env Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant