🚨 Warning |
---|
This project was abandoned! |
Browser friendly, promise based JS and CSS loader.
cdn-buddy will live in a variable you may declare:
__CDN_BUDDY_NAMESPACE = 'myBuddy' // defaults to cdnBuddy
__CDN_BUDDY_NAMESPACE = 'cdn'
require('cdn-buddy')
cdn.setConfig({
"baseUrl" : "https://unpkg.com/",
"paths": {
"jquery" : "[email protected]/dist/jquery.min.js"
}
})
(async function() {
await cdn.require(['jquery', '[email protected]/dist/vue.js'])
await cdn.require(['jquery-ui'])
// Your dependent code goes here
})()
<script src="cdn-buddy/dist/cdn-buddy.min.js"></script>
<script>
cdnBuddy.require(['jquery', '[email protected]/dist/vue.js']).then(function() {
$('body').css('backgroundColor', 'lime')
})
</script>