text: 'use strict';
  
  var paths = {
      js: ['*.js', 'server/*.js', 'server/**/*.js', 'public/**/*.js', 'test/**/*.js', '!test/coverage/**', '!public/bower_components/**', '!/node_modules/**', '!insertMockMongoData.js'],
      html: ['public/*.html', 'public/**/*.html'],
      css: ['public/**/css/*.css', '!public/bower_components/**']
  };
  
  module.exports = function(grunt) {
  
      if (process.env.NODE_ENV !== 'production') {
          require('time-grunt')(grunt);
      }
  
      // Project Configuration
      grunt.initConfig({
          pkg: grunt.file.readJSON('package.json'),
          assets: grunt.file.readJSON('server/config/assets.json'),
          clean: ['public/build'],
          watch: {
              js: {
                  files: paths.js,
                  tasks: ['jshint'],
                  options: {
                      livereload: true
                  }
              },
              html: {
                  files: paths.html,
                  options: {
                      livereload: true
                  }
              },
              css: {
                  files: paths.css,
                  tasks: ['csslint'],
                  options: {
                      livereload: true
                  }
              }
          },
          jshint: {
              all: {
                  src: paths.js,
                  options: {
                      jshintrc: true
                  }
              }
          },
          uglify: {
              core: {
                  options: {
                      mangle: false
                  },
                  files: '<%= assets.core.js %>'
              }
          },
          csslint: {
              options: {
                  csslintrc: '.csslintrc'
              },
              src: paths.css
          },
          cssmin: {
              core: {
                  files: '<%= assets.core.css %>'
              }
          },
          nodemon: {
              dev: {
                  script: 'server/server.js',
                  options: {
                      args: [],
                      ignore: ['public/**', 'node_modules/**'],
                      ext: 'js,html',
                      nodeArgs: ['--debug'],
                      delayTime: 1,
                      env: {
                          PORT: require('./server/config/config').port
                      },
                      cwd: __dirname
                  }
              }
          },
          concurrent: {
              tasks: ['nodemon', 'watch'],
              options: {
                  logConcurrentOutput: true
              }
          },
          mochaTest: {
              options: {
                  reporter: 'spec',
                  require: 'server/server.js'
              },
              src: ['test/mocha/*.js']
          },
          env: {
              test: {
                  NODE_ENV: 'test'
              }
          },
          karma: {
              unit: {
                  configFile: 'test/karma/karma.conf.js'
              }
          }
      });
  
      //Load NPM tasks
      require('load-grunt-tasks')(grunt);
  
      //Default task(s).
      if (process.env.NODE_ENV === 'production') {
          grunt.registerTask('default', ['clean','cssmin', 'uglify', 'concurrent']);
      } else {
          grunt.registerTask('default', ['clean','jshint', 'csslint', 'concurrent']);
      }
  
      //Test task.
      grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);
  
      // For Heroku users only.
      // Docs: https://github.com/linnovate/mean/wiki/Deploying-on-Heroku
      grunt.registerTask('heroku:production', ['cssmin', 'uglify']);
  };
  