Skip to content

ng build environment option not working since upgrade to 1.2.3 #7118

@Bidthedog

Description

@Bidthedog

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

MINGW64 /f/code_temp/testing (master)
$ ng -v
_ _ ____ _ ___
/ \ _ __ __ _ _ | | __ _ _ __ / | | | |
/ △ \ | '
\ / _ | | | | |/ _ | '
| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/
@angular/cli: 1.2.3
node: 6.9.4
os: win32 x64
@angular/animations: 4.3.1
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/cli: 1.2.3
@angular/compiler-cli: 4.3.1
@angular/language-service: 4.3.1

Repro steps.

  • Download this zip - https://www.dropbox.com/s/zb7f2pjx5lenbsx/testing.zip?dl=0
  • Zip has been generated today with @angular/cli 1.2.3. The only modifications I've made are to add two new environments (LIVE and TEST), remove the "prod" environment from .angular-cli.json, and add the two new environment files in /environments
  • run npm install
  • run any variation of the ng build command, with an environment parameter, e.g:

ng build -e TEST
ng build -env:TEST
ng build --environment TEST
ng build --environment "TEST"

etc...

  • After each run, check if the dist/main.bundle.js file contains the transformed properties. The "dev" settings are used regardless of the environment I specify.

The log given by the failure.

N/A

Desired functionality.

The relevant environment file should be used to perform transformations on the final environment settings. I believe I have tried all variations and read all the documentation.

Because we have to perform the transformation at build time, these environment names are shared with our back-end build. Case is important, and "prod" is not required due to the naming of our environments.

Mention any other details that might be useful.

This was working in 1.1.1 on our build server. I used "ng build -e TEST" or "ng build -e LIVE" previously.

This happens locally (Win 8.1) and on our build server (Current VSO Hosted Agent - cli version confirmed).

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