Added the ability for a webjar's module dependency and other requirejs configuration to be specified in a webjars-requirejs.js file. This file is expected at the root of the META-INF/resources/webjars/{artifactId}/{version} folder. If present then the file is loaded before any other files of this webjar. For example the following contents:

requirejs.config({
  shim: {
    jquery: [ 'webjars!jquery.js' ]
  }
});

Permits an alias to be defined for jquery. If a module requests a dependency on "jquery" e.g.:

define(["jquery"…

then requirejs will be sure to download the webjar for jquery first.

If a module does not use AMD e.g. the bootstrap library, then a configuration can be provided with the webjar for bootstrap like:

requirejs.config({
  shim: {
    'bootstrap': [ 'webjars!jquery.js' ]
  }
});

This will ensure that when bootstrap is loaded from the webjar then jquery will be loaded first.