0

I am trying to add a local environment configuration file to generate the build.

            "environmentSource": "environments/environment.ts",
            "environments": {
             "dev": "environments/environment.ts",
             "prod": "environments/environment.prod.ts",
             "local": "environments/environment.local.ts",
             "staging": "environments/environment.staging.ts"
        }

But it is saying "Invalid build target. Only 'development' and 'production' are available. " I am on the following angular environment:

Angular CLI: 1.6.0 Node: 9.2.0

OS: linux x64

Angular: 5.1.0 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, platform-server, router

@angular/cli: 1.6.0

@angular-devkit/build-optimizer: 0.0.35

@angular-devkit/core: 0.0.22

@angular-devkit/schematics: 0.0.41

@ngtools/json-schema: 1.1.0

@ngtools/webpack: 1.9.0

@schematics/angular: 0.1.10

@schematics/schematics: 0.0.10

typescript: 2.4.0

webpack: 3.10.0

1 Answer 1

4

You need to specify the environment with the --environment flag. What you probably tried is changing the target (--target), which is different and only works for production and development

https://github.com/angular/angular-cli/wiki/build

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.