Angular-cli: 6.0.0-rc.0: Migration of asset configuration broken

Created on 3 Apr 2018  Â·  4Comments  Â·  Source: angular/angular-cli

Versions

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

@angular/cdk: 6.0.0-rc.0
@angular/cli: 6.0.0-rc.0
@angular/material: 6.0.0-rc.0
@angular-devkit/architect: 0.0.10
@angular-devkit/build-angular: 0.0.10
@angular-devkit/build-optimizer: 0.4.9
@angular-devkit/core: 0.4.9
@angular-devkit/schematics: 0.5.0
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 6.0.0-beta.9
typescript: 2.7.2
webpack: 4.1.0

Repro steps

  • Have a project built with angular-cli 1.7 with an entry like this in .angular-cli.json:
    "apps": [
        {
            // …
            "assets": [
                "assets",
                "favicon.ico"
            ]
        }
    ]

(assets is a folder and favicon.ico is a file)

  • Upgrade to 6.0.0-rc.0
  • run ng update @angular/cli --migrate-only --from=1.7.1 as requested

Observed behavior

angular.json is created with entries like this under projects/my-project/architect/build/options:

            "assets": [
              {
                "glob": "assets",
                "input": "/src",
                "output": "/"
              },
              {
                "glob": "favicon.ico",
                "input": "/src",
                "output": "/"
              },

Which does not match the desired files in both cases

Desired behavior

I had to change it to this:

            "assets": [
              {
                "glob": "assets/**",
                "input": "src",
                "output": "/"
              },
              {
                "glob": "favicon.ico",
                "input": "src",
                "output": "/"
              },

Most helpful comment

Would just like to chime in that we need to fix it to be this instead:

              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "/assets"
              },

The difference is that the former would copy what was inside src/assets to /, whereas the latter copies it to /assets.

All 4 comments

Would just like to chime in that we need to fix it to be this instead:

              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "/assets"
              },

The difference is that the former would copy what was inside src/assets to /, whereas the latter copies it to /assets.

@filipesilva can I share my .angular-cli.json with you, because I sacred on ng update command :)

I have two app dev&prod, only difference are "allowOutsideOutDir" in prod to get /assets once in dist

@istiti you can save your work before running the update command, and if something goes wrong you just discard the changes in git. They won't be automatically committed.

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

NCC1701M picture NCC1701M  Â·  3Comments

gotschmarcel picture gotschmarcel  Â·  3Comments

rwillmer picture rwillmer  Â·  3Comments

sysmat picture sysmat  Â·  3Comments

daBishMan picture daBishMan  Â·  3Comments