Similar to stusmith's suggestion, you can use StealJS to compile EJS templates(or any js file).
Within your app files you can setup dependencies, such as your templates and other resources:
steal('jquery', 'template_a.ejs', 'template_b.ejs', function() { //some app code});
Then you can use the steal build tool to combine all your dependencies into one or many minified, concatenated files.