dotenv specifically has an option (override), disabled by default, to control whether the .env file overwrites any existing system values. dotenv-webpack does not have such an option, and its behaviour appears to be to overwrite by default; the opposite of dotenv. At the very least, there should be an option to control this behaviour, but I would expect the defaults to match also.
Here is my config
new Dotenv({
path: path.join(__dirname, 'js.env.local'),
defaults: path.join(__dirname, 'js.env'),
expand: true,
}),
dotenv specifically has an option (
override), disabled by default, to control whether the.envfile overwrites any existing system values. dotenv-webpack does not have such an option, and its behaviour appears to be to overwrite by default; the opposite ofdotenv. At the very least, there should be an option to control this behaviour, but I would expect the defaults to match also.Here is my config