make scripts.php an index to control what gets included and what not. And output the result
Concatenate the included files (OSEA_CONCATENATE_JS option to functions.php)
Minify files or the concatenated output (OSEA_MINIFY_JS option to functions.php)
I also entertain the idea of using scripts.php as a tool to compile the final scripts.js instead of being used as a live wrapper for dynamic compilation. I wonder what the speed difference would be.
Make it simple enough.
I also entertain the idea of using scripts.php as a tool to compile the final scripts.js instead of being used as a live wrapper for dynamic compilation. I wonder what the speed difference would be.