title: Grunt is removing scripts and css in index.html
body: <p>I have app deployed on heroku for some time. I always add components using <code>bower install</code> and then grunt to minimize, uglify and concatinate. </p>
  
  <p><strong>I have used yeoman to generate my Gruntfile.js</strong></p>
  
  <p>I installed a new library, included it in my index.html and run <code>grunt</code> command, it suddenly got removed from my index.html</p>
  
  <p><strong>On the left side, is what happens after I run Grunt, the right side is before I run grunt command</strong></p>
  
  <p><a href="https://i.stack.imgur.com/k1j3m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k1j3m.png" alt="Diff of css files removed"></a></p>
  
  <p><strong>Here is a diff of the single javascript file removed</strong>
  <a href="https://i.stack.imgur.com/8ZaHX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ZaHX.png" alt="javascript file removed"></a></p>
  
  <p>Here is the bower.json file</p>
  
  <pre><code>{
    "name": "civilization-web",
    "version": "0.0.0",
    "dependencies": {
      "lodash": "2.4.1",
      "angular": "~1.3.8",
      "json3": "~3.3.1",
      "es5-shim": "~3.1.0",
      "bootstrap": "~3.3.1",
      "angular-resource": "~1.3.7",
      "angular-sanitize": "~1.3.7",
      "angular-animate": "~1.3.7",
      "angular-touch": "~1.3.7",
      "angular-route": "~1.3.7",
      "angular-utf8-base64": "~0.0.5",
      "angular-messages": "~1.3.8",
      "ng-table": "~0.3.3",
      "angular-bootstrap": "~0.12.0",
      "ng-file-upload": "~2.0.5",
      "ng-file-upload-shim": "~2.0.5",
      "angular-growl-v2": "~0.7.3",
      "nya-bootstrap-select": "~2.0.8",
      "animate.css": "~3.2.6",
      "angular-bootstrap-simple-chat": "~0.3.1",
      "angularjs-scroll-glue": "~0.0.1"
    },
    "devDependencies": {
      "angular-mocks": "~1.3.7",
      "angular-scenario": "~1.3.7"
    },
    "appPath": "app",
    "resolutions": {
      "angular": "1.3.8"
    }
  }
  </code></pre>
  
  <p><strong>Here is my GruntFile.js</strong></p>
  
  <pre><code>// Generated on 2015-05-12 using generator-angular 0.11.1
  'use strict';
  
  // # Globbing
  // for performance reasons we're only matching one level down:
  // 'test/spec/{,*/}*.js'
  // use this if you want to recursively match all subfolders:
  // 'test/spec/**/*.js'
  
  module.exports = function (grunt) {
  
      // Load grunt tasks automatically
      require('load-grunt-tasks')(grunt);
  
      // Time how long tasks take. Can help when optimizing build times
      require('time-grunt')(grunt);
  
      // Configurable paths for the application
      var appConfig = {
          app: require('./bower.json').appPath || 'app',
          dist: 'dist'
      };
  
      // Define the configuration for all the tasks
      grunt.initConfig({
  
          // Project settings
          yeoman: appConfig,
  
          // Watches files for changes and runs tasks based on the changed files
          watch: {
              bower: {
                  files: ['bower.json'],
                  tasks: ['wiredep']
              },
              js: {
                  files: ['&lt;%= yeoman.app %&gt;/scripts/{,*/}*.js'],
                  tasks: ['newer:jshint:all'],
                  options: {
                      livereload: '&lt;%= connect.options.livereload %&gt;'
                  }
              },
              styles: {
                  files: ['&lt;%= yeoman.app %&gt;/styles/{,*/}*.css'],
                  tasks: ['newer:copy:styles', 'autoprefixer']
              },
              gruntfile: {
                  files: ['Gruntfile.js']
              },
              livereload: {
                  options: {
                      livereload: '&lt;%= connect.options.livereload %&gt;'
                  },
                  files: [
                      '&lt;%= yeoman.app %&gt;/{,*/}*.html',
                      '.tmp/styles/{,*/}*.css',
                      '&lt;%= yeoman.app %&gt;/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                  ]
              }
          },
  
          // The actual grunt server settings
          connect: {
              options: {
                  port: 9000,
                  // Change this to '0.0.0.0' to access the server from outside.
                  hostname: 'localhost',
                  livereload: 35729
              },
              livereload: {
                  options: {
                      open: true,
                      middleware: function (connect) {
                          return [
                              connect.static('.tmp'),
                              connect().use(
                                  '/bower_components',
                                  connect.static('./bower_components')
                              ),
                              connect().use(
                                  '/app/styles',
                                  connect.static('./app/styles')
                              ),
                              connect.static(appConfig.app)
                          ];
                      }
                  }
              },
              dist: {
                  options: {
                      open: true,
                      base: '&lt;%= yeoman.dist %&gt;'
                  }
              }
          },
  
          // Make sure code styles are up to par and there are no obvious mistakes
          jshint: {
              options: {
                  jshintrc: '.jshintrc',
                  reporter: require('jshint-stylish')
              },
              all: {
                  src: [
                      'Gruntfile.js',
                      '&lt;%= yeoman.app %&gt;/scripts/{,*/}*.js'
                  ]
              }
          },
  
          // Empties folders to start fresh
          clean: {
              dist: {
                  files: [{
                      dot: true,
                      src: [
                          '.tmp',
                          '&lt;%= yeoman.dist %&gt;/{,*/}*',
                          '!&lt;%= yeoman.dist %&gt;/.git{,*/}*'
                      ]
                  }]
              },
              server: '.tmp'
          },
  
          // Add vendor prefixed styles
          autoprefixer: {
              options: {
                  browsers: ['last 1 version']
              },
              server: {
                  options: {
                      map: true,
                  },
                  files: [{
                      expand: true,
                      cwd: '.tmp/styles/',
                      src: '{,*/}*.css',
                      dest: '.tmp/styles/'
                  }]
              },
              dist: {
                  files: [{
                      expand: true,
                      cwd: '.tmp/styles/',
                      src: '{,*/}*.css',
                      dest: '.tmp/styles/'
                  }]
              }
          },
  
          // Automatically inject Bower components into the app
          wiredep: {
              app: {
                  src: ['&lt;%= yeoman.app %&gt;/index.html'],
                  ignorePath:  /\.\.\//
              }
          },
  
          // Reads HTML for usemin blocks to enable smart builds that automatically
          // concat, minify and revision files. Creates configurations in memory so
          // additional tasks can operate on them
          useminPrepare: {
              html: '&lt;%= yeoman.app %&gt;/index.html',
              options: {
                  dest: '&lt;%= yeoman.dist %&gt;',
                  flow: {
                      html: {
                          steps: {
                              //js: ['concat', 'uglifyjs'],
                              js: ['concat'],
                              css: ['cssmin']
                          },
                          post: {}
                      }
                  }
              }
          },
  
          // Performs rewrites based on filerev and the useminPrepare configuration
          usemin: {
              html: ['&lt;%= yeoman.dist %&gt;/{,*/}*.html'],
              css: ['&lt;%= yeoman.dist %&gt;/styles/{,*/}*.css'],
              options: {
                  assetsDirs: [
                      '&lt;%= yeoman.dist %&gt;',
                      '&lt;%= yeoman.dist %&gt;/styles'
                  ]
              }
          },
  
  
          imagemin: {
              dist: {
                  files: [{
                      expand: true,
                      cwd: '&lt;%= yeoman.app %&gt;/images',
                      src: '{,*/}*.{png,jpg,jpeg,gif}',
                      dest: '&lt;%= yeoman.dist %&gt;/images'
                  }]
              }
          },
  
          svgmin: {
              dist: {
                  files: [{
                      expand: true,
                      cwd: '&lt;%= yeoman.app %&gt;/images',
                      src: '{,*/}*.svg',
                      dest: '&lt;%= yeoman.dist %&gt;/images'
                  }]
              }
          },
  
          htmlmin: {
              dist: {
                  options: {
                      collapseWhitespace: true,
                      conservativeCollapse: true,
                      collapseBooleanAttributes: true,
                      removeCommentsFromCDATA: true,
                      removeOptionalTags: true
                  },
                  files: [{
                      expand: true,
                      cwd: '&lt;%= yeoman.dist %&gt;',
                      src: ['*.html', 'views/{,*/}*.html'],
                      dest: '&lt;%= yeoman.dist %&gt;'
                  }]
              }
          },
  
          // ng-annotate tries to make the code safe for minification automatically
          // by using the Angular long form for dependency injection.
          ngAnnotate: {
              dist: {
                  files: [{
                      expand: true,
                      cwd: '.tmp/concat/scripts',
                      src: '*.js',
                      dest: '.tmp/concat/scripts'
                  }]
              }
          },
  
          // Replace Google CDN references
          cdnify: {
              dist: {
                  html: ['&lt;%= yeoman.dist %&gt;/*.html']
              }
          },
  
          // Copies remaining files to places other tasks can use
          copy: {
              dist: {
                  files: [{
                      expand: true,
                      dot: true,
                      cwd: '&lt;%= yeoman.app %&gt;',
                      dest: '&lt;%= yeoman.dist %&gt;',
                      src: [
                          '*.{ico,png,txt}',
                          '.htaccess',
                          '*.html',
                          'views/{,*/}*.html',
                          'images/{,*/}*.{webp}',
                          'styles/fonts/{,*/}*.*'
                      ]
                  }, {
                      expand: true,
                      cwd: '.tmp/images',
                      dest: '&lt;%= yeoman.dist %&gt;/images',
                      src: ['generated/*']
                  }, {
                      expand: true,
                      cwd: 'bower_components/bootstrap/dist',
                      src: 'fonts/*',
                      dest: '&lt;%= yeoman.dist %&gt;'
                  }]
              },
              styles: {
                  expand: true,
                  cwd: '&lt;%= yeoman.app %&gt;/styles',
                  dest: '.tmp/styles/',
                  src: '{,*/}*.css'
              }
          },
  
          // Run some tasks in parallel to speed up the build process
          concurrent: {
              server: [
                  'copy:styles'
              ],
              dist: [
                  'copy:styles',
                  'imagemin',
                  'svgmin'
              ]
          }
      });
  
  
      grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
          if (target === 'dist') {
              return grunt.task.run(['build', 'connect:dist:keepalive']);
          }
  
          grunt.task.run([
              'clean:server',
              'wiredep',
              'concurrent:server',
              'autoprefixer:server',
              'connect:livereload',
              'watch'
          ]);
      });
  
      grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
          grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
          grunt.task.run(['serve:' + target]);
      });
  
      grunt.registerTask('build', [
          'clean:dist',
          'wiredep',
          'useminPrepare',
          'concurrent:dist',
          'autoprefixer',
          'concat',
          'ngAnnotate',
          'copy:dist',
          'cdnify',
          'cssmin',
          //'uglify',
          'usemin',
          'htmlmin'
      ]);
  
      grunt.registerTask('default', [
          'newer:jshint',
          'build'
      ]);
  };
  </code></pre>
  
  <p><strong>Does anyone know why Grunt is removing this files when I run Grunt?</strong></p>
  
  <p><a href="https://github.com/cash1981/civilization-boardgame-web" rel="nofollow noreferrer">PS: My code is on github, you can view it there</a></p>