Ability to check for variable presence
Closed this issue · 5 comments
Hi, it would be nice if there would be an option that ensures that build fails when there is missing environment variable. We do this manually in the ember-cli-build.js at the moment, but I guess this could be a part of this addon.
Basically, when you run ember b --environment production
it would check if all defined keys in clientAllowedKeys
are not empty, otherwise it would fail the build. This prevents situation when someone is deploying and doesn't have all the required variables set. At the moment, this would pass silently and then you get runtime errors in your app, which is really unfortunate.
Thanks,
Ondrej
@ondrejsevcik I'd be open to this. I'd prefer to make it optional and disabled by default to avoid a breaking change in 2.x.
I would be more happy if that would be enabled by default, because it's a good practice, but that thing with breaking change sounds reasonable.
In 3.0 we can start throwing by default but for now a warning unless your configure it to throw. I'd like to let 2.0 marinate a bit longer before we jump to 3.0.
Yeah, that sounds good to me. I will send PR hopefully in a next few days.
Closed via #45.