Skip to content

asset copying won't let the same directory be copied to multiple locations #7752

@Matmo10

Description

@Matmo10

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

macOS Sierra

@angular/cli: 1.4.1
node: 8.5.0
os: darwin x64
@angular/common: 5.0.0-beta.4
@angular/compiler: 5.0.0-beta.4
@angular/core: 5.0.0-beta.4
@angular/forms: 5.0.0-beta.4
@angular/http: 5.0.0-beta.4
@angular/platform-browser: 5.0.0-beta.4
@angular/platform-browser-dynamic: 5.0.0-beta.4
@angular/router: 5.0.0-beta.4
@angular/cli: 1.4.1
@angular/compiler-cli: 5.0.0-beta.4
@angular/language-service: 5.0.0-beta.4
typescript: 2.4.2

Repro steps.

Have an .angular-cli.json with the following assets config:

"assets": [
            "assets",
            {
               "glob": "**/*",
               "input": "./assets/img",
               "output": "./img"
            }
         ],

ng build -prod or any build step that produces the dist directory.

The problem.

dist/img doesn't exist once the build is done. If you switch the order of the two entries so that the glob pattern runs first and "assets" runs second, then only dist/img is created, but dist/assets/img is copied, and the rest of the assets are not. So there is some type of merging or interaction between the copy commands when they should be separate. This worked fine in earlier releases, like 1.3.1 for example, but I'm not sure which version changed this.

Desired functionality.

The entries in the assets array should not affect each other as long as the output directories are distinct. Before someone asks, yes, I want the same files copied to multiple places (dist/assets/img/ and dist/img/).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: @angular-devkit/build-angulartype: bug/fix

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions