title: Alternate grunt.js tasks for development/production environments
body: <p>I would really love to be able to have a development grunt file and using the same file an production version of the script.</p>
  
  <p>I have tried the suggestion on SO but my script will just fail when trying to call a dev/prod argument. I believe that the answer is for an older version of grunt, or maybe the plugins I am using.</p>
  
  <pre><code>module.exports = function (grunt) {
  
      // load all grunt tasks
      require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
  
      grunt.initConfig({
          pkg: grunt.file.readJSON('package.json'),
          compass: {
              dev: {
                  options: {
                      config: 'config.rb',
                      force: true,
                      livereload: true
                  }
              }
          },
          uglify: {
              build: {
                  src: ['docroot/js/*.js', 'docroot/components/**/*.js'],
                  dest: 'docroot/dis/main.min.js'
              }
          },
          watch: {
              options: {
                  dateFormat: function(time) {
                      grunt.log.writeln('The watch finished in ' + time + 'ms at' + (new Date()).toString());
                      grunt.log.writeln('Waiting for more changes...');
                  },
                  livereload: true
              },
              sass: {
                  files: ['docroot/sass/*.scss'],
                  tasks: ['compass:dev']
              },
              /* watch and see if our javascript files change, or new packages are installed */
              js: {
                  files: '&lt;%= uglify.build.src %&gt;',
                  tasks: ['uglify']
              },
              /* watch our files for change, reload */
              livereload: {
                  files: ['*.html', 'docroot/css/*.css', 'docroot/img/*', 'docroot/js/{main.min.js, plugins.min.js}'],
                  options: {
                      livereload: true
                  }
              }
          }
      });
  
  
      grunt.registerTask('default', 'watch');
  };
  </code></pre>
  
  <p>Really, so long as I can get two version running by calling them with, for example:</p>
  
  <pre><code> grunt //local
   grunt prod //live
  </code></pre>
  
  <p>then I can play around with the scripts and what to load.</p>