angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

CDN support with fallback mechanism

Open StefanRKarlsson opened this issue 9 years ago • 6 comments

OS?

Windows 10

Versions.

angular-cli: 1.0.0-beta.24 node: 6.9.1 os: win32 x64 @angular/common: 2.4.1 @angular/compiler: 2.4.1 @angular/compiler-cli: 2.4.1 @angular/core: 2.4.1 @angular/forms: 2.4.1 @angular/http: 2.4.1 @angular/platform-browser: 2.4.1 @angular/platform-browser-dynamic: 2.4.1 @angular/router: 3.4.1

Mention any other details that might be useful.

Is there any plans to support loading script & styles from a CDN with fallback to the local file system? I would like it to be dependent on which environment you set. Is this possible to do with or without the cli right now?

Why do i want this?

Let's say i use the minified and bundled versions of jQuery and jQueryUI i will get the pros that most people already have it cached. I also imagine that loading from a CDN i faster and makes my local files smaller for webpack to handle.

StefanRKarlsson avatar Jan 10 '17 09:01 StefanRKarlsson

In a previous project we would build two index.html files, one without CDN prefixes and one with them.

To turn CDN on/off we would just symlink index.html to the generated index-cdn.html or index-nocdn.html

I would imagine you would really want to think long and hard about the security impact of pushing application bundles into a CDN.

It might be best to just push css bundles, fonts and images to CDN.

martinmcwhorter avatar Jan 14 '17 20:01 martinmcwhorter

Thats one option that can work, the only problem i can see is how to implement the fallback mecanism.

What security issues do you mean? Clientside code is allways visible. What would putting it in CDN change?

StefanRKarlsson avatar Jan 14 '17 20:01 StefanRKarlsson

The security implication is not that the bundles can be read. The concern is that your application is only as secure as your CDN provider when you offload JavaScript bundles.

This is not so much a concern for css bundles, fonts and images.

On Sat, 14 Jan 2017, 20:12 Stefan Karlsson, [email protected] wrote:

Thats one option that can work, the only problem i can see is how to implement the fallback mecanism.

What security issues do you mean? Clientside code is allways visible. What would putting it in CDN change?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/3933#issuecomment-272649784, or mute the thread https://github.com/notifications/unsubscribe-auth/ABI5-rSVy2S83VlfEGQC3m1u5rKhxdGHks5rSSxIgaJpZM4LfMMH .

martinmcwhorter avatar Jan 14 '17 20:01 martinmcwhorter

How do you implement a CDN with a fallback solution inside an Angular Project that was created with Angular CLI? I have the same environment as @StefanRKarlsson

brookhutchinson avatar Jan 15 '17 15:01 brookhutchinson

Dupe of https://github.com/angular/angular-cli/issues/1310

filipesilva avatar May 22 '17 15:05 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.