Skip to content

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

@tordans

Description

@tordans

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions