Open girvo opened 8 years ago
Never mind, it does exactly that! Using the {%javascripts filter="?requirejs" %}
block, it will use that as an entry-point.
The one thing to be aware is that it has to point to a Javascript file that looks like this:
require([
'dependencies',
'go',
'here/including/your/modules'
], function() {
});
NOT a regular define()
module!
Using the
r.js
optimiser, is it possible to define multiple entry points? If I'm using the Assetic filter, is it smart enough to ahead-of-time compile the required entrypoint? The reason why I ask, is that different pages load different JS entrypoints, whichrequire()
their dependencies, and it'd be awesome if ther.js
optimiser when used with this bundle would handle that!