Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple bundles? #78

Open
girvo opened this issue Oct 3, 2015 · 1 comment
Open

Multiple bundles? #78

girvo opened this issue Oct 3, 2015 · 1 comment

Comments

@girvo
Copy link

girvo commented Oct 3, 2015

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, which require() their dependencies, and it'd be awesome if the r.js optimiser when used with this bundle would handle that!

@girvo
Copy link
Author

girvo commented Oct 14, 2015

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant