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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load nuxt config with different envName
for env-specific configs
#357
Comments
envName
for env-specific configsenvName
for env-specific configs
Can you share more context in what common usecases this might be useful to use something different from |
E.g. deploying a project in a staging environment. Here I want the NODE_ENV to be "production" but need some other variable to differentiate between staging and production. We currently use process.env.TARGET for that and manually select and merge custom config-files depending on process.env.TARGET. We are not the only ones facing this issue (https://www.youtube.com/watch?v=sCzO4fpKOW4) but it's possible I just don't get how to solve this in a more nuxt-fashioned way. |
In addition to @fmoessle's comment, |
This is a bug we might try to fix first. |
I think this is intentional, isn't it? 馃憖 Line 5 in 5cdb2f5
|
It is intentionally set because tools (notably postcss stuff) hardly depend on It is not intentional that we don't respect it for c12 configuration env. |
And allow to use environment overrides for all custom environments (ex: staging) |
Hey all 馃憢
c12 provides us with the amazing opportunity to add env-specific configs to the nuxt config (also covered in my video), therefore relying on
NODE_ENV
by default. While it is technically possible to change theenvName
value, e.g. by patching the CLI or similar, it would be nice to have some kind of flag which changes theenvName
to a different env variable, such asTARGET
,APP_ENV
etc.The text was updated successfully, but these errors were encountered: