Angular-cli: Update Wiki for 6.x

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

We need to update the Wiki to include command options and journey updates.

To track the wiki stories:

  • [x] application-environments (pr - #10537)
  • [x] asset-configuration (pr - https://github.com/angular/angular-cli/pull/10538)
  • [x] autoprefixer (no changes needed)
  • [x] budgets (pr - #10495)
  • [x] code-coverage (pr - #10498)
  • [x] configure-hmr (pr - #10500)
  • [x] continuous-integration (no changes needed)
  • [x] css-preprocessors (pr - #10501)
  • [x] disk-serve (no changes needed)
  • [x] github-pages (no changes needed)
  • [x] global-lib (pr - https://github.com/angular/angular-cli/pull/10541)
  • [x] global-scripts (pr - https://github.com/angular/angular-cli/pull/10541)
  • [x] global-styles (pr - https://github.com/angular/angular-cli/pull/10541)
  • [x] include-angular-flex (no changes needed)
  • [x] include-angular-material (no changes needed)
  • [x] include-angularfire (no changes needed)
  • [x] include-bootstrap (pr - #10503)
  • [x] include-font-awesome (pr - #10505)
  • [x] internationalization (pr - https://github.com/angular/angular-cli/pull/10543)
  • [x] linked-library (replaced with lib creation pr - https://github.com/angular/angular-cli/pull/10545)
  • [x] moving-into-the-cli (removed in pr https://github.com/angular/angular-cli/pull/10546)
  • [x] moving-out-of-the-cli (removed in pr https://github.com/angular/angular-cli/pull/10546)
  • [x] multiple-apps (replaced by multiple projects in pr https://github.com/angular/angular-cli/pull/10548)
  • [x] proxy (pr - https://github.com/angular/angular-cli/pull/10553)
  • [x] routing (no changes needed)
  • [x] third-party-lib (no changes needed)
  • [x] universal-rendering (pr - https://github.com/angular/angular-cli/pull/10554)
  • [x] using-corporate-proxy (pr - https://github.com/angular/angular-cli/pull/10553)
  • [x] replace angular-cli.md with angular.md containing the config file description (pr - https://github.com/angular/angular-cli/pull/10562)

We also need to update the docs for individual commands.

  • [x] auto generate command wiki docs (https://github.com/angular/angular-cli/pull/10470)
  • [x] update description on top of command pages (pr - https://github.com/angular/angular-cli/pull/10560)
  • [x] add arguments for generate commands (pr - https://github.com/angular/angular-cli/pull/10583)

We also need to add a link to the old docs

  • [x] add a link to the old docs (pr - https://github.com/angular/angular-cli/pull/10555)

After a release, we should add schema links to the workspace file docs

  • [x] add range links to the CLI schema file in the workspace doc (pr - https://github.com/angular/angular-cli/pull/10578)
2 (required) docs

Most helpful comment

We'll also need to add the library doc there.

All 10 comments

We'll also need to add the library doc there.

Currently even after watching presentation angular.json is out of scope to me, i have to generate same app in two app (due to i18n) and I want different architect.build.options (remove some assets from one)

I can run ng build --configuration=myConf it will point architect.build.configurations but what about architect.build.options how have multiple options?
like ng build --options=myOptions

Thanks @filipesilva

Heya @istiti, you can override any options you want in configurations. For instance, you can have:

"architect": {
  "build": {
    "builder": "@angular-devkit/build-angular:browser",
    "options": {
      "assets": [
        {
          "glob": "**/*",
          "input": "src/assets",
          "output": "/assets"
        }
      ],
    },
    "configurations": {
      "language-fr": {
        "i18nLocale": "fr",
        "i18nFile": "src/locale/messages.fr.xlf",
        "assets": [],
      },
      "language-de": {
        "i18nLocale": "de",
        "i18nFile": "src/locale/messages.de.xlf",
        "assets": [],
      }
    }
  },

This should give you i18n for two different languages, without assets. Is this what you wanted?

@filipesilva thanks but have you tried this ?
because on my side if I reset asse to empty array I get:
cli6rc7

I copy exactly your config and run ng b -c=fr it seems because assets reset to empty array it stop command without error, if I remove assets:[] it works it compile, might be a bug ?

@filipesilva If i put options like sourceMap into architect.build.options it is also applied to architect.serve.options?

I want to set defaults for build like "sourceMap": false which should not be applied to serve. But right now i have to repeat myself:

"configurations": {
            "testing": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.testing.ts"
                }
              ],
              "sourceMap": false,             
            },
            "staging": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.staging.ts",
                }
              ],
              "sourceMap": false,
            },
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "sourceMap": false,
            }
}

@istiti that is indeed a bug, I know what's wrong and will fix (https://github.com/angular/devkit/pull/819)

@MickL Yes, what you put in build will be applied to serve since the dev server will use the build options. However, sourceMap is one of the (few) build options that you can override in serve (https://github.com/angular/devkit/pull/734).

Reopening as this was not meant to be closed (yet).

configure-hmr (pr - #10500)

If you follow the docs, you will end up with

Schema validation failed with the following errors:
  Data path "['serve'].configurations['hmr']" should be object.
Error: Schema validation failed with the following errors:
  Data path "['serve'].configurations['hmr']" should be object.

Fixed with PR #10592

@robertbaker sorry for that, I have pushed a fix in https://github.com/angular/angular-cli/pull/10603. The file replacement was also missing.

I'm closing this issue because all the items I had in the original list are addressed.

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