grunt-strip-debug

Strip console and debugger statements from JavaScript code

npm install grunt-strip-debug
7 downloads in the last week
12 downloads in the last month

grunt-strip-debug Build Status

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: {                              // task
        dist: {                                // target
            files: {                           // dictionary of files
                'dist/app.js': 'src/app.js'    // destination : source
            }
        }
    }
});

grunt.loadNpmTasks('grunt-strip-debug');
grunt.registerTask('default', ['stripDebug']);

License

MIT © Sindre Sorhus

npm loves you