See generated code. The problem with minimizing AngularJS is that dependency nesting is based on parameter names and, as such, will break when minimized.
For example, this line
function routes($stateProvider, $urlRouterProvider) {
may look like
function routes(a, b) {
and then Angular will not know which dependency to inject, and you will get an Unknown provider error.
To fix this, you can use array syntax (see Inline Array Annotation).
['$dependencyA', '$dependencyB', function($dependencyA, $dependencyB)
because minified will look like
['$dependencyA', '$dependencyB', function(a, b)
and then Angular knows what to do.
In your case, it will be something like
.config(['$stateProvider', '$urlRouterProvider', routes]);
source share