I would like to include this library (Bootbox) . It does have a an npm package, but I would like to include it via its CDN (public url).
What is the right way to include external javascript (and css) files which reside on publicly accessible servers?
If you don't want it in your vendor.js file, the only way I know is to import it in your index.html.
Just place it in your index.html with a script tag.
By the way, you can create an addon, that only has an index.js that implements the content-for hook. This hook can insert the script tag for you. e.g:
contentFor:function(type, config){
if(type==='head'){ //or body, choose the appropriate one for you
return "<script src='...'></script>"
}
}
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