🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

webpack-strip

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-strip

Webpack loader to strip arbitrary functions out of your production code.

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Webpack Strip

Simple Webpack loader to strip custom functions from your code. This can be useful if you want to use debug statements while developing your app but don't want this info exposed in your production code.

##Usage:

In your client js source files:


var debug = require('debug')('MyFile');

var makeFoo = function () {
    // The following two lines of code will be stripped with our webpack loader
    debug('makeFoo called');
    debug('makeFoo args', arguments);
    // This code would remain
    return 'Foo';
};

Single function

In your webpack config:

{
    module: {
        loaders: [
            { test: /\.js$/, loader: "webpack-strip?strip[]=debug" }
        ]
    }
};

Multiple functions

In your webpack config:

{
    module: {
        loaders: [
            { test: /\.js$/, loader: "webpack-strip?strip[]=debug,strip[]=console.log" }
        ]
    }
};

Use as library

In your webpack config:

var WebpackStrip = require('webpack-strip')
{
    module: {
        loaders: [
            { test: /\.js$/, loader: WebpackStrip.loader('debug', 'console.log') }
        ]
    }
};

Keywords

webpack

FAQs

Package last updated on 20 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts