Take a look at grunt-usemin. With this task you can add comments to your head around your script/style tags. The task will find all sources between the start/end of the comment and concat/minify/build requirejs for this files
<!-- build:js build/js/app.js -->
<script src="js/controllers/thing-controller.js"></script>
<script src="js/models/thing-model.js"></script>
<script src="js/views/thing-view.js"></script>
<!-- endbuild -->
This block for example will result in a file app.js holding all the minified/concatenated files and create a new html file that replace the block with <script src="build/js/app.js"></script>