Using CDN with ember-cli

In my application developed using ember-cli, I also need external resources such as bootstrap; Now I import it through Brocfile:

app.import('bower_components/bootstrap/dist/css/bootstrap.css'); app.import('bower_components/bootstrap/dist/js/bootstrap.js'); 

Is it possible to use a CDN instead of a local file, also defining a callback to the local file if there is no CDN?

+5
source share
1 answer

Ember-cli-cdn sounds like a partial solution to a problem for me. Here is a quote from the Readme:

This addon allows you to work with local copies of libraries during development, and then automate the transition to your version of CDN when you deploy your application.

But it does not solve the problem of "backing up to a local file if the CDN is offline." The only template I know (also used by ember) is to put the script load at the end of the html, allowing the page to display even if the CDN is not responding.

+1
source

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


All Articles