Using SystemJS, how do I specify that one library depends on another? For example, the Bootstrap JavaScript library depends on jQuery. Based on the SytemJS docs, I assumed I would specify this dependency using System.config.meta
property:
System.config({
baseUrl: './scripts',
defaultJSExtensions: true,
map: {
jquery: './lib/jquery-2.2.0.min.js',
bootstrap: './lib/bootstrap.min.js'
},
meta: {
bootstrap: {
deps: ['jquery']
}
}
});
System.import('./scripts/app.js');
But this seems to have no effect. When I run my application, the Bootstrap library throws a Bootstrap's JavaScript requires jQuery
error - which means Bootstrap is being loaded before jQuery.
How can I ensure that jQuery is always loaded before Bootstrap?
window
explicitly. – Sceverwindow.$ = window.jQuery = require('jQuery')
, put that code anywhere before the inclusion of the bootstrap files. It's ugly, but that's the way Twitter likes it. – Scever