Angular-cli: Unable to set project defaults in 6.0.0-rc.5

Created on 23 Apr 2018  路  5Comments  路  Source: angular/angular-cli

Trying to update to angular 6, and I'm running into a couple issues while trying to set default behaviors on the project. Any help would be greatly appreciated!

Versions

Angular CLI: 6.0.0-rc.5
Node: 8.10.0
OS: darwin x64
Angular: 6.0.0-rc.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.7
@angular-devkit/build-angular     0.5.7
@angular-devkit/build-optimizer   0.5.7
@angular-devkit/core              0.5.7
@angular-devkit/schematics        0.5.7
@angular/cli                      6.0.0-rc.5
@ngtools/json-schema              1.1.0
@ngtools/webpack                  6.0.0-rc.5
@schematics/angular               0.5.7
@schematics/update                0.5.7
rxjs                              6.0.0-turbo-rc.4
typescript                        2.7.2
webpack                           4.5.0

Repro steps

  • Try to set project defaults
  "defaults": {
    "styleExt": "scss",
    "serve": {
      "port": 4203
    }
  }

Observed behavior

Adding defaults property to angular.json throws error:
Schema validation failed with the following errors: Data path "" should NOT have additional properties(defaults)

Desired behavior

Copied over from angular json from previous version.

  • Project should run on 4203
  • scss should be the default style extension

Most helpful comment

in angular.json

        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "formation:build",
            "port": 5001
          },

All 5 comments

The defaults key is in the cli key now. You will need to add it there.

thanks @hansl! is there a schema with the new format documented that I could take a look at?

@hansl I am facing the same issue. I am not sure where should I add these in new angular.json file.
I tried the cli command and all gives errors.

in angular.json

        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "formation:build",
            "port": 5001
          },

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajjejosefsson picture rajjejosefsson  路  3Comments

purushottamjha picture purushottamjha  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments