Skip to content

Proposal: build environment names should be checked against .angular-cli.json config #8927

@nicholasserra

Description

@nicholasserra

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.

I think this will help debugging. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIssue that requests a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions