grunt-strip-debug 
Strip console, alert, and debugger statements from JavaScript code with strip-debug
Getting Started
If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:
$ npm install --save-dev grunt-strip-debug
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-strip-debug');
Tip: the load-grunt-tasks module makes it easier to load multiple grunt tasks.
Example
grunt.initConfig({
stripDebug: {
dist: {
files: {
'dist/app.js': 'src/app.js'
}
}
}
});
grunt.loadNpmTasks('grunt-strip-debug');
grunt.registerTask('default', ['stripDebug']);
License
MIT © Sindre Sorhus