Solution 1
If using Apache, you could install mod_pagespeed (an open-source Apache module created by Google to help Make the Web Faster by rewriting web pages to reduce latency and bandwidth) with its rewrite_javascript option.
Solution 2
Use a CDN which offers minification options such as CloudFlare with its AutoMinify option.
Its not good solution. Depends on your js file size, it can be painfull for your server. Best way is to use some uglify php script to generate new files. Original files just put to the non public folder. I.e:
/application
/scripts
/public
/js/ {dynamic content / cache}
/index.php
Inside scripts you put original files. You can clear cache manualy or by cron, using some special address and generating new js files. If you want automatic way, you can always check modify date of your scripts and generate new one if changed - slower, but still better way than generating scripts everytime