validate environment variables used in `runtimeConfig`
they need to match the object pattern - would be nice if we could provide support for this
Maybe move to plugin repo?
I was thinking to rename to nuxt/eslint and include plugin in this repo.
Looks good to me!
@danielroe Could you elaborate more on what you expect on this? I could give it a try
I'm thinking:
export default defineNuxtConfig({
runtimeConfig: {
// should be process.env.NUXT_GITHUB_TOKEN
githubToken: process.env.MY_GITHUB_TOKEN,
public: {
// should be process.env.NUXT_PUBLIC_SOME_VAR
someVar: process.env.SOMEVAR
}
}
})
The reason being that often people are not aware that their nuxt config isn't 'reread' in production. And they may have these variables set in an env - which works in dev, but will fail when built.
It should also be valid to set these variables to some value without referencing process.env