SHOHIL SETHIA
SHOHIL SETHIA

Reputation: 2227

Angular-CLI does not accept cdn's in .angular-cli.json

How to make angular-cli understand that whenever we are adding any CDN (Deployed Url) of any Styles or Scripts. It should recognize that!

So far we need to add cdn's to index.html, as adding them to .angular-cli.json has no effect!

Is there any work around?

Upvotes: 4

Views: 6830

Answers (2)

SHOHIL SETHIA
SHOHIL SETHIA

Reputation: 2227

I was searching regarding this issue, Rather then i found issues filed in Git in the Angular-CLI,

Someone may want to read CDN Styles/ Scripts in .angular-cli.json configuration and also this deploying with libraries linked to cdn in system-config.js .

It clearly states they are not planning to implement this feature, So therefore this feature itself is not present with Angular-Cli.

Hope this helps to other queries !

Upvotes: 3

Hamed Baatour
Hamed Baatour

Reputation: 6932

the official CLI docs states:

these(referring to styles and scripts) will be loaded exactly as if you had added them in a tag inside index.html

so why do you want to add CDN link to your .angular-cli.json. Adding styles and script files to the CLI config from CDN is not supported as the default behavior will fetch a local path but again no difference whatsoever in here between adding them to the index.html and .angular-cli.json as stated in the docs.

Upvotes: 2

Related Questions