In my app, developed using ember-cli, I need also some external resources like bootstrap; now I'm importing it through the 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 local file, defining also a callback to local file in case the CDN is offline?
Ember-cli-cdn sounds like a partial solution to the problem to me. Here is a quote from the Readme:
This addon allows to work with local copies of libraries during development, and then automate switching to your CDN version when you deploy your application.
But it doesn't solve the "fallback to local file if CDN is offline" problem. The only pattern I am aware of (also used in ember) is to put the script loading at the end of the html allowing page rendering even if the CDN isn't responding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With