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

Investigate react-env for runtime .env switch #126

Open
eric-burel opened this issue Sep 10, 2021 · 0 comments
Open

Investigate react-env for runtime .env switch #126

eric-burel opened this issue Sep 10, 2021 · 0 comments
Labels
enhancement New feature or request nextjs

Comments

@eric-burel
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Next.js will bake NEXT_PUBLIC_* client variables at build time. So you cannot change those variables at runtime.

react-env brings the possibility of loading the variables at runtime instead. It's great for easy switch between different environment during development, or changing the route of an API. You just nee to restart the server, instead of building it.

This way, the client app behaviour is closer to the server behaviour regarding env variable: you simply need to restart to apply the change, instead of rebuilding. This is in particular less confusing for devops, that have the habit of just restarting the app to apply changes.

Describe alternatives you've considered
Node-config does something similar with JSON files => it would be closer to what exists in Meteor
React-env is closer to what exists in Next.js (env based configuration)

@eric-burel eric-burel added enhancement New feature or request nextjs labels Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nextjs
Projects
None yet
Development

No branches or pull requests

1 participant