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:
- bloats the code (even minified)
- 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:
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.