-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
Description
Hi!
I find splitting dotenv files by environment to be very restricting. I've seen whole blog posts arguing that it's a bad practice.
Instead, I organize my dotenv files by deploy target, e. g. development, staging, production. This unleashes my debugging capabilities, letting me make production builds against a local server and unminified builds against production server.
To achieve that, I use a very simple technique in ember-cli-build.js:
const target = process.env.APPNAME_DEPLOY_TARGET || 'localhost-4200'
const dotEnvFile = `./.env-${target}`
if (!fs.existsSync(dotEnvFile)) throw new Error(`ember-cli-build.js: dot-env file not found: ${dotEnvFile}`) dotEnv: {
path: dotEnvFile
}I believe this should be part of the addon. Doing ember s --dotenv .env-production is a feature that everyone would expect from the addon.
hectorh30