Angular-cli adding styles from an external url

Hi guys, is there a way to load CSS styles from an external url?

For example, I have domain.eu, but on my site in sub.domain.eu I want to use styles that are stored in this domain. (These styles are common to all sites).

The example below does not work.

"styles": [
    "styles.css",
    "http://domain.eu/themes/css/common.css"
  ],

The problem is that webpack is trying to link these styles. He can't get it. when i import it via css

@import('url');

It will not break, but it will have problems with missing resources such as images or fonts.

The only solution is to add an external CSS style to index.hml. But is it possible to set this value dynamically?

, , .., , , , - -,

+4
2

, , CSS, styleUrls: ['file name.css'] @Component

0

"styles": [ "styles.css", " http://domain.eu/themes/css/common.css" ]

css , css ,

styleUrls: ['styles.css', 'http://domain.eu/themes/css/common.css']

0

Source: https://habr.com/ru/post/1672219/


All Articles