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

Refactor the use of process.env.NODE_ENV and …env.CONTEXT #994

Open
tordans opened this issue Mar 17, 2022 · 0 comments
Open

Refactor the use of process.env.NODE_ENV and …env.CONTEXT #994

tordans opened this issue Mar 17, 2022 · 0 comments

Comments

@tordans
Copy link
Contributor

tordans commented Mar 17, 2022

The code relies on those values in multiple places.

We should have a central place to handle this information. The code should only look at this central place for information.

We should have helper methods that are true/false for …

  • development only
  • anything that is non-production on fixmyberlin.de (local dev, branch previews, staging preview)
  • anything that runs in tests only(?)
    webpack/webpack.common.js:
       20  const BABEL_PLUGINS =
       21:   process.env.NODE_ENV === 'production' ||
       22    process.env.CYPRESS_INTERNAL_ENV === 'production'
    

This can rely on Netlify data like https://docs.netlify.com/site-deploys/overview/#deploy-contexts.

tordans added a commit that referenced this issue Mar 17, 2022
tordans added a commit that referenced this issue Jul 6, 2022
tordans added a commit that referenced this issue Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant