module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    bower_concat: {
      libraries: {
        exclude: [
          'bootstrap'
        ],
        dest: 'app/dist/lib.js'
      }
    },

    'angular-builder': {
      options: {
        mainModule: 'app'
      },
      app: {
        src:  ['app/features/**/*.js', '!app/features/views/**/*.js'],
        dest: 'app/dist/app.js'
      }
    }
  });

  grunt.loadNpmTasks('grunt-bower-concat');
  grunt.loadNpmTasks('grunt-angular-builder');

  grunt.registerTask('default', [
    'bower_concat',
    'angular-builder'
  ]);
};

@@ -96,16 +96,40 @@
 json'),%0A
+    clean: %5B'app/dist'%5D,
 %0A    bow
@@ -331,72 +331,289 @@
 app'
-%0A      %7D,%0A      app: %7B%0A        src:  %5B'app/features/**/*.js', '!
+,%0A        externalModules: %5B'ngRoute'%5D,%0A        excludedModules: %5B'app.views'%5D%0A      %7D,%0A      app: %7B%0A        src:  %5B'app/features/**/*.js'%5D,%0A        dest: 'app/dist/app.js'%0A      %7D%0A    %7D,%0A%0A    copy: %7B%0A      viewsModule: %7B%0A        flatten: true,%0A        expand: true,%0A        src: '
 app/
@@ -627,25 +627,31 @@
 s/views/
-**/*
+viewsModule
 .js'
-%5D
 ,%0A      
@@ -660,38 +660,32 @@
 dest: 'app/dist/
-app.js
 '%0A      %7D%0A    %7D%0A
@@ -735,16 +735,105 @@
 ncat');%0A
+  grunt.loadNpmTasks('grunt-contrib-copy');%0A  grunt.loadNpmTasks('grunt-contrib-clean');%0A
   grunt.
@@ -906,16 +906,29 @@
 ult', %5B%0A
+    'clean',%0A
     'bow
@@ -960,16 +960,28 @@
 builder'
+,%0A    'copy'
 %0A  %5D);%0A%7D

add clean and copy tasks (viewsModule) set angular-builder to ignore app.views