Is it possible to load external jQuery from CDN when it needed like in RequireJS? I mean specify external jQuery source (on CDN) somewhere in config and then use it in CommonJS (or AMD) style:
$ = require('jquery')
The problem is I have my custom script above the jQuery's CDN link and so I have 'can't find variable jQuery' error. Schematically my code looks like:
<script src="custom_code.js'>
// uncompiled source like:
define(['jquery', '../../node_modules/baconjs/dist/Bacon.js'], function($, bacon) {
console.log 'ok'
});
</script>
...
<script src="//yastatic.net/jquery/2.1.3/jquery.min.js"></script>