Skip to content

consider "output" path in serve mode for assets configuration  #7773

Closed
@elvisbegovic

Description

@elvisbegovic
  • bug report

Versions.

@angular/cli: 1.4.2
node: 6.11.0
os: win32 x64
@angular/...: 4.4.3
@angular/cli: 1.4.2
typescript: 2.3.4

Repro steps.

I have multi language app, I know I need build for each language and actually output is:

/fr -> /assets
/de -> /assets

with this configuration in angular-cli

"assets": [
        "assets",
        "favicon.ico"
      ],

And in all my template component I use ressources from assets like : <img src="assets/images/avatar2.jpg" />

This ABOVE works for ng serve and ng b !

PROBLEM:

What I want is: have only one /assets folder like

/fr
/de
/assets

So I simply edit my angular-cli config file to put assets one level higher :

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

And in all my template I juste specify one level higher like : <img src="../assets/images/avatar2.jpg" />

PROBLEM: this only works on ng build NOT on ng serve !

The log given by the failure.

image

Mention any other details that might be useful.

to build I simply use "ng build --prod --output-path dist/fr --locale fr --bh /fr/ --i18n-format xtb --i18n-file src/locale/fr.xtb

What I expect

Is it possible to considere "output" path of assets in DEVELOPEMENT mode server ? Or how achieve this behavior ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions