webjars/webjars-play — pull request #5 by huntc (2013-03-01 08:05:48+00:00)
Title: A webjar-enabled require.js method

These changes provide a new "requirejs" method that produces JavaScript to load a webjar-enabled require.js.

The JavaScript will build a map of webjar identifiers and their respective webjar paths. After the map is produced a require.js configuration is established so that a require.js "webjars" loader is declared. The loader is declared once require.js itself is loaded. The webjar hosted require.js is loaded as the last step of this script.

The webjars loader will resolve webjar identifiers to their fully qualified path, thus:

define(['webjars!angular.js'],

will resolve to the path associated with angular.js hosted within a webjar on the server.

A demonstration of this new capability can be found at https://github.com/huntc/angular-seed-play