Skip to content

Webpack loader to remove debug from your production code.

License

Notifications You must be signed in to change notification settings

johngodley/webpack-remove-debug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Webpack Remove Debug

A very simple Webpack loader to remove debug from your code.

You might want to include debug in your development code, but remove all traces of it from your production code.

This is similar to strip-loader, but requires no parameters and only works for debug, and with very specific conditions.

It removes function calls:

debug( 'Some debug line', stuff );

It also removes the require (no support for import):

const debug = require( 'debug' )( 'yourapp:morestuff' );

Install

npm install --save-dev webpack-remove-debug

Configuration

In your Webpack 1 config:

{
    module: {
        loaders: [
            {
				test: /\.js$/,
				loader: 'webpack-remove-debug'
			}
        ]
    }
};

In your Webpack 2 config:

{
    module: {
        rules: [
            {
				test: /\.js$/,
				loader: 'webpack-remove-debug'
			}
        ]
    }
};

About

Webpack loader to remove debug from your production code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published