Skip to content

Cannot change environment at runtime #2508

@Lasagna220

Description

@Lasagna220

We would like to be able to change the environment at runtime. Currently, this is not possible, as the environment.ts file gets compiled into the main.bundle.js with the rest of the code. Instead, the dist should have a separate environment.js file, so that it can be replaced at runtime.

Setting the environment at runtime is a very important feature for release pipelines. It does not make sense to build an artifact to test on a lower environment, and then have to build a new artifact for production. Being able to pass an artifact off to the higher environment provides assurance that you are releasing the same thing that you tested.

Versions.

angular-cli: 1.0.0-beta.15
node: 6.6.0
os: darwin x64

Repro steps.

ng build
Notice that the dist directory does not have a file dedicated to environment config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions