在Cakephp中将2个或更多.js文件连接成一个文件的正确方法

Suppose I have:

  • common.js
  • scriptA.js
  • scriptB.js

And suppose that both scriptA and scriptB require functions that are in common.js Instead of copy-pasting common.js in both files, I would like to send a concatenation of common+scriptA and common+scriptB as needed.

I don't want to do $.getScript(... because that would cause another request for getting the script.

How do I do this? Is there a better way!?