You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just spent a while debugging an issue with specifying named build environments that could have been avoided if appropriate warnings were thrown in advance.
Proposal:
Running the command ng build --environment=staging should first check to ensure that staging is a valid choice in the .angular-cli.json > apps[0]['environments'] object before attempting to run.
Currently, if there exists no such environment, the build will just default to development environment settings.
In my case, I came into an existing project that had no environments object in the config and was tasked with making it work. I incorrectly added the environments to the root of the config.
After reading the build doc several times I finally noticed the only mention that environments needs to be nested within the apps[0] object halfway down the page.