hearsayit/HearsayRequireJSBundle — pull request #30 by fixe (2013-05-22 15:24:12+00:00)
Title: Added shim support

This PR adds shim support to this bundle.

bower.json
```
{
"name": "Project name",
"version": "1.0.0",

"dependencies": {
"angular": "latest",
"jquery": "latest",
"requirejs": "latest"
}
}
```

.bowerrc
```json
{
"directory" : "src/Acme/ProjectBundle/Resources/public/components"
}
```

base.html.twig
```twig
{% block javascripts %}
{% javascripts filter='?requirejs' '@AcmeProjectBundle/Resources/public/js/apps/dashboard.js' %}
{{ require_js_initialize({ 'main' : asset_url }) }}
{% endjavascripts %}
{% endblock %}
```

requirejs.yml
```yml
hearsay_require_js:
paths:
angular: @AcmeProjectBundle/Resources/public/components/angular/angular
jquery: @AcmeProjectBundle/Resources/public/components/jquery/jquery

shim:
-
name: angular
deps: [jquery]
exports: angular
```

dashboard.js
```javascript
require(['angular'], function(angular) {
console.log(angular);
});
```