(with the help of a PHP template)
Up to know I had to combine the files externally before uploading them to the system, but recently I found a quite simple and elegant workaround for that specific problem.
First step is to define the scripts you want to combine.
Next step is to integrate the template you just created in your Pagelayouts.
You need to load jQuery (do it localy, of course!) to get the option to embed jQuery-Templates. Alongside the default ones there should be the new one (j_scripts) available now:
As you might notice the file is located in the assets directory (just like the combined CSS one line above it) which means it’s not just speeding things up by reducing multiple server request to just one, but by storing the single file inside the internal Cache of Contao, too — if the Cache is activated of course.
Pretty neat, huh?