RequireJS is a really powerful tool to deal with modules and dependencies. It also provides a great optimizer, which allows you to have your entire application (or part of it, as needed) in a single file. It even can uglify the code, which means your code will no longer be human readable.
However, when your project gets complex, it can be very, very difficult to deal with the configuration. Although it is always possible to come up with a solution for your project, sometimes, you just need to add extra configuration only for the optimizer.
Grunt can help you do that, because it must be reminded that this tool is "only" a Nodejs application. This characteristic will allow you to interact with your project...