title: How to stop minification of js files in grunt?
body: <p>I am new to grunt. I have nearly 20-30 js files in my project. I came to know that We are already using grunt to minify and concatenate them. For debug purpose I need to stop minification but retain them in concatenated form. Could any one suggest how to proceed. Any site which has the related tutorials would be helpful.Thanks in advance.</p>
  
  <pre><code>module.exports = function(grunt) {
   var readJSFile = function(data, path){
      var finalArray = [];
      if(path == 'assets/js/'){
          finalArray.push('&lt;%= copy.options.buildFolder %&gt;/JSON-words.js');
      }
      for(var item in data.main){
          finalArray.push('&lt;%= copy.options.buildFolder %&gt;/'+path+data.main[item].file);
      }
      return finalArray;
  }
  grunt.initConfig({
      pkg: grunt.file.readJSON('package.json'),
      exec: {
          update: {
              command: 'TortoiseProc.exe /command:update /path:"./**" /closeonend:3'
          }
      },
      copy: {
          options : {
              buildFolder : '../../deliverables/&lt;%= pkg.folder %&gt;/&lt;%= grunt.template.today("yyyymmdd") %&gt;-htdocs'
          },
          main: {
              files: [
                  {expand: true, src: ['./**'], dest: '&lt;%= copy.options.buildFolder %&gt;'}
              ]
          }
      }, 
      'useminPrepare': {
          html: ['&lt;%= copy.options.buildFolder %&gt;/inc/general/head.html', '&lt;%= copy.options.buildFolder %&gt;/inc/general/foot.html', '&lt;%= copy.options.buildFolder %&gt;/inc/module/print.html']
      },
      usemin: {
        html: ['&lt;%= copy.options.buildFolder %&gt;/inc/general/head.html', '&lt;%= copy.options.buildFolder %&gt;/inc/general/foot.html', '&lt;%= copy.options.buildFolder %&gt;/inc/module/print.html']
      },
      concat: {
          options: {
              separator: ''
          },
  
          // JS build starts here
          mainJS: {
              src : readJSFile(grunt.file.readJSON('buildFiles/mainjs.json'), 'assets/js/'),
              dest: '&lt;%= copy.options.buildFolder %&gt;/assets/js/&lt;%= pkg.name %&gt;.min.js'
          },
          libheaderJS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/headerjs.json'), 'assets/js/libs/headerJS/'),
              dest: '&lt;%= copy.options.buildFolder %&gt;/assets/js/libs/headerJS/ladbrokes.lib.top.js'
          },
          libbetdaqJS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/betdaqjs.json'), 'assets/js/libs/betdaqJS/'),
              dest: '&lt;%= copy.options.buildFolder %&gt;/assets/js/libs/betdaqJS/ladbrokes.betdaq.js'
          },
          commonJS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/common.json'), 'assets/js/'),
              dest: '&lt;%= copy.options.buildFolder %&gt;/assets/js/common.min.js'
          },
          racingJS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/racing.json'), 'assets/js/'),
              dest: '&lt;%= copy.options.buildFolder %&gt;/assets/js/racing.min.js'
          },
          landingJS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/landing.json'), 'assets/js/'),
              dest: '&lt;%= copy.options.buildFolder %&gt;/assets/js/landing.min.js'
          },
          // ladbrokes.min.css starts here
          mainCSS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/maincss.json'), 'assets/css/'),
              dest : '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes.min.css'
          },
          globalCSS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/globalcss.json'), 'assets/css/'),
              dest : '&lt;%= copy.options.buildFolder %&gt;/assets/css/global.min.css'
          },
          responsiveCSS: {
              src: readJSFile(grunt.file.readJSON('buildFiles/responsivecss.json'), 'assets/css/'),
              dest : '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes.responsive.css'
          }
      },
      uglify: {
          options: {
             // dont make comma separted all the statements so that it can be debug on live env.
              compress :{
                  sequences : false
              },
              banner: '/*! &lt;%= pkg.name %&gt; &lt;%= grunt.template.today("dd-mm-yyyy") %&gt; &lt;%= grunt.template.today("HH-MM-ss") %&gt; */\n'
          },
          mainJS: {
              files: {
                '&lt;%= copy.options.buildFolder %&gt;/assets/js/&lt;%= pkg.name %&gt;.min.js': ['&lt;%= concat.mainJS.dest %&gt;']
              }
          },
          libheaderJS: {
              files: {
                '&lt;%= copy.options.buildFolder %&gt;/assets/js/libs/headerJS/ladbrokes.lib.top.js': ['&lt;%= concat.libheaderJS.dest %&gt;']
              }
          },
          libbetdaqJS: {
              files: {
                  '&lt;%= copy.options.buildFolder %&gt;/assets/js/libs/betdaqJS/ladbrokes.betdaq.js': ['&lt;%= concat.libbetdaqJS.dest %&gt;']
              }
          },
          commonJS: {
              files: {
                  '&lt;%= copy.options.buildFolder %&gt;/assets/js/common.min.js': ['&lt;%= concat.commonJS.dest %&gt;']
              }
          },
          racingJS: {
               files: {
                  '&lt;%= copy.options.buildFolder %&gt;/assets/js/racing.min.js': ['&lt;%= concat.racingJS.dest %&gt;']
              }
          },
          landingJS: {
              files: {
                  '&lt;%= copy.options.buildFolder %&gt;/assets/js/landing.min.js': ['&lt;%= concat.landingJS.dest %&gt;']
              }
          },
          configJS: {
              files: {
                '&lt;%= copy.options.buildFolder %&gt;/assets/js/ladbrokes.config.prod.min.js': ['&lt;%= copy.options.buildFolder %&gt;/assets/js/ladbrokes.config.prod.js']
              }
          }
      },
       // CSS build starts here
      cssmin: {
          my_target: {
             src: '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes.min.css',
             dest : '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes.min.css'
          },
          globalCSS: {
            src : '&lt;%= copy.options.buildFolder %&gt;/assets/css/global.min.css',
            dest : '&lt;%= copy.options.buildFolder %&gt;/assets/css/global.min.css'
          },
          printCSS: {
            src: '&lt;%= copy.options.buildFolder %&gt;/assets/css/print.css',
            dest: '&lt;%= copy.options.buildFolder %&gt;/assets/css/print.min.css'
          },
          racingCSS: {
            src: '&lt;%= copy.options.buildFolder %&gt;/assets/css/racing.css',
            dest: '&lt;%= copy.options.buildFolder %&gt;/assets/css/racing.min.css'
          },
          landingCSS: {
            src: '&lt;%= copy.options.buildFolder %&gt;/assets/css/landing.css',
            dest: '&lt;%= copy.options.buildFolder %&gt;/assets/css/landing.min.css'
          },
          responsiveCSS:{
            src: '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes.responsive.css',
            dest: '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes.responsive.min.css'  
          }
  
      },
  
      clean: {
          options: {
              force: true
          },
          src0: '&lt;%= concat.mainJS.src %&gt;',
          src1: '&lt;%= concat.libheaderJS.src %&gt;',
          src3: '&lt;%= concat.mainCSS.src %&gt;',
          src4: '&lt;%= concat.globalCSS.src %&gt;',
          src5: [
              '&lt;%= copy.options.buildFolder %&gt;/script',
              '&lt;%= copy.options.buildFolder %&gt;/buildFiles',
              '&lt;%= copy.options.buildFolder %&gt;/node_modules',
              '&lt;%= copy.options.buildFolder %&gt;/Gruntfile.js',
              '&lt;%= copy.options.buildFolder %&gt;/package.json',
              '&lt;%= copy.options.buildFolder %&gt;/assets/js/libs/headerJS/jquery.min.js',
              '&lt;%= copy.options.buildFolder %&gt;/assets/js/ladbrokes.config.dev.js',
              '&lt;%= copy.options.buildFolder %&gt;/assets/js/libs/footerJS/mtagconfig.js', 
              '&lt;%= copy.options.buildFolder %&gt;/assets/js/libs/footerJS/plugins.js',
              '&lt;%= copy.options.buildFolder %&gt;/assets/js/ladbrokes.beta.js', 
              '&lt;%= copy.options.buildFolder %&gt;/assets/js/ladbrokes.config.prod.js',
              '&lt;%= copy.options.buildFolder %&gt;/assets/js/respond.js',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/global.css', 
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/print.css', 
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/beta-site.css', 
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/betslip.css', 
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/mediaelementplayer.min.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/landing.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/minigames.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/nownextpool.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/racing.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/toteslip.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/*.scss',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes.responsive.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/generic-responsive.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/higher-resolution.css',
              '&lt;%= copy.options.buildFolder %&gt;/assets/css/ladbrokes-maxw-1200.css',
              '&lt;%= copy.options.buildFolder %&gt;/JSON-words.js'
          ],
          src6: readJSFile(grunt.file.readJSON('buildFiles/jsIgnore.json'), 'assets/js/'),
          src7: '&lt;%= concat.libbetdaqJS.src %&gt;',
      },
  
  
      shell: {
          add: {
             command: 'TortoiseProc.exe /command:commit /path:"&lt;%= copy.options.buildFolder %&gt;/"/logmsg:"Please verify this build before commit !" /closeonend:0'
          }
      },
  
      smushit: {
          path:{
              src:'&lt;%= copy.options.buildFolder %&gt;/assets/images'
          }
      }
  
  
  });
  
  grunt.loadNpmTasks('grunt-exec');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-usemin');
  grunt.loadNpmTasks('grunt-css');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-rename');
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-smushit');
  
  grunt.registerTask('default', [
      'exec', 
      'copy', 
      'concat', 
      'uglify', 
      'cssmin', 
      'useminPrepare', 
      'usemin', 
      'clean'/*, 'smushit'*/, 
      'shell'
      ]
  );
  </code></pre>
  
  <p>};</p>