Skip to content

Relative path for assets array in angular-cli.json file not working #2933

@maxailloud

Description

@maxailloud

Hi guys,

Using relative path for dealing with assets is not working. For example if I want to use images as my assets from a node module folder.

OS?

Mac OSX Sierra

Versions.

angular-cli: 1.0.0-beta.18
node: 6.8.1
os: darwin x64

Repro steps.

This is what my angular-cli.json file looks like:

{
  "project": {
    "version": "1.0.0-beta.18",
    "name": "project_name"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "build",
      "assets": [
          "assets",
          "../node_modules/my_module/assets"
      ],
      "index": "index.html",
      "main": "main.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.json",
      "prefix": "app",
      "mobile": false,
      "styles": [
        "bootstrap.scss",
        "style.scss"
      ],
      "scripts": [
          "../node_modules/node-uuid/uuid.js"
      ],
      "environments": {
        "source": "environments/environment.ts",
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "addons": [],
  "packages": [],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "prefixInterfaces": false
  }
}

The log given by the failure.

No error, just the assets files from the node_modules folder aren't copied to the dist, build for me, one.

Mention any other details that might be useful.

In the case of relative path I think it should copy the files from the specified folder without keeping the hierarchy. Just taking files and folder in it but without recreating the whole hierarchy of folder in the assets folder.

By the way images from the src/assets folder are correctly copied into dist.

So i don't know if it's known or not but I think it can be really useful, for me I'm creating packages for my app and some will have images in them.

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