Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #6642
Closed
Open
Issue created Mar 14, 2019 by Administrator@rootContributor

replace dotenv with dotenv-webpack?

Created by: Nickman87

Is this a bug report?

No

Description

We are using a .env file to make configuration changes easy between our different environments and it works great. However, the way that dotenv works it not particularly interesting as it:

  1. bloats the code (even minified)
  2. exposes all environment variables right next to each other (the values will become public anyway, but you don't need them to be right next to each other)

In our codebase, we have a couple of variables and this block is inserted six times into our code: Image of Yaktocat

In a project without create-react-app I've been using dotenv-webpack with great success. It effectively replaces your call to an environment variable with the value itself, minimizing code bloat.

I believe this would be a small change in the code, but I was wondering if there are reasons not to do this? If there is no reason not to switch it, I would like to work on a PR.

Assignee
Assign to
Time tracking