Skip to content

6.0.0-rc.0: Migration of asset configuration broken #10146

Closed

Description

@bananer

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": "/"
              },

Activity

  1. filipesilva commented on Apr 3, 2018

    @filipesilva
    Contributor

    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.

  2. elvisbegovic commented on Apr 4, 2018

    @elvisbegovic
    Contributor

    @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

  3. filipesilva commented on Apr 4, 2018

    @filipesilva
    Contributor

    @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.

  4. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  5. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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