How do you bundle multiple AMD modules in a single file?

Viewed 5301

AMD seems to be the best practice to load javascript modules as-needed.

This should work great on large web-apps where users only use a fraction of the available functionality.

I've read about the optimizer, which concatenates all required modules into a single file, and I've read about no optimization, i.e. loading each module with a async request.

Both don't seem to fit this use-case: loading every module with a request might quickly result in a large number of request, whereas optimizing forces you to download all the code.

Is there a way to bundle multiple modules into a single file?

2 Answers
Related