Skip to content
This repository has been archived by the owner on Jan 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2 from yahoo/rename
Browse files Browse the repository at this point in the history
Rename to strip-loader
  • Loading branch information
Vijar committed Jan 21, 2015
2 parents ed45cff + 90f118d commit 3492700
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Contributing Code to `webpack-strip`
Contributing Code to `strip-loader`
-------------------------------

Please be sure to sign our [CLA][] before you submit pull requests or otherwise contribute to `webpack-strip`. This protects developers, who rely on [BSD license][].
Please be sure to sign our [CLA][] before you submit pull requests or otherwise contribute to `strip-loader`. This protects developers, who rely on [BSD license][].

[BSD license]: https://github.com/yahoo/webpack-strip/blob/master/LICENSE.md
[BSD license]: https://github.com/yahoo/strip-loader/blob/master/LICENSE.md
[CLA]: https://yahoocla.herokuapp.com/
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Webpack Strip
# Strip Loader

[![npm version](https://badge.fury.io/js/webpack-strip.svg)](http://badge.fury.io/js/webpack-strip)
[![Build Status](https://travis-ci.org/yahoo/webpack-strip.svg?branch=master)](https://travis-ci.org/yahoo/webpack-strip)
[![Dependency Status](https://david-dm.org/yahoo/webpack-strip.svg)](https://david-dm.org/yahoo/webpack-strip)
[![devDependency Status](https://david-dm.org/yahoo/webpack-strip/dev-status.svg)](https://david-dm.org/yahoo/webpack-strip#info=devDependencies)
[![Coverage Status](https://coveralls.io/repos/yahoo/webpack-strip/badge.png?branch=master)](https://coveralls.io/r/yahoo/webpack-strip?branch=master)
[![npm version](https://badge.fury.io/js/strip-loader.svg)](http://badge.fury.io/js/strip-loader)
[![Build Status](https://travis-ci.org/yahoo/strip-loader.svg?branch=master)](https://travis-ci.org/yahoo/strip-loader)
[![Dependency Status](https://david-dm.org/yahoo/strip-loader.svg)](https://david-dm.org/yahoo/strip-loader)
[![devDependency Status](https://david-dm.org/yahoo/strip-loader/dev-status.svg)](https://david-dm.org/yahoo/strip-loader#info=devDependencies)
[![Coverage Status](https://coveralls.io/repos/yahoo/strip-loader/badge.png?branch=master)](https://coveralls.io/r/yahoo/strip-loader?branch=master)

Simple [Webpack](http://webpack.github.io/) 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.


## Install

`npm install --save-dev webpack-strip`
`npm install --save-dev strip-loader`

## Usage

Expand All @@ -38,7 +38,7 @@ In your webpack config:
{
module: {
loaders: [
{ test: /\.js$/, loader: "webpack-strip?strip[]=debug" }
{ test: /\.js$/, loader: "strip-loader?strip[]=debug" }
]
}
};
Expand All @@ -51,7 +51,7 @@ In your webpack config:
{
module: {
loaders: [
{ test: /\.js$/, loader: "webpack-strip?strip[]=debug,strip[]=console.log" }
{ test: /\.js$/, loader: "strip-loader?strip[]=debug,strip[]=console.log" }
]
}
};
Expand All @@ -61,8 +61,9 @@ In your webpack config:
In your webpack config:

```javascript
var WebpackStrip = require('webpack-strip')
{
var WebpackStrip = require('strip-loader');

var webpackConfig = {
module: {
loaders: [
{ test: /\.js$/, loader: WebpackStrip.loader('debug', 'console.log') }
Expand All @@ -71,9 +72,23 @@ var WebpackStrip = require('webpack-strip')
};
```

### Remove stripped functions from bundle

So far we've removed the calls to the debug function, but webpack will still include the `debug` module in the final bundle. Use the [`IgnorePlugin`](http://webpack.github.io/docs/list-of-plugins.html#ignoreplugin)

```javascript
{
plugins: [
new webpack.IgnorePlugin(/debug/)
]
}
```



## License

This software is free to use under the Yahoo! Inc. BSD license.
See the [LICENSE file][] for license text and copyright information.

[LICENSE file]: https://github.com/yahoo/webpack-strip/blob/master/LICENSE.md
[LICENSE file]: https://github.com/yahoo/strip-loader/blob/master/LICENSE.md
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "webpack-strip",
"name": "strip-loader",
"version": "0.1.0",
"description": "Webpack loader to strip arbitrary functions out of your production code.",
"main": "lib/index.js",
Expand All @@ -14,7 +14,7 @@
],
"repository": {
"type": "git",
"url": "[email protected]:yahoo/webpack-strip"
"url": "[email protected]:yahoo/strip-loader"
},
"author": "Rajiv Tirumalareddy <[email protected]>",
"devDependencies": {
Expand All @@ -31,7 +31,7 @@
"licenses": [
{
"type": "BSD",
"url": "https://github.com/yahoo/webpack-strip/blob/master/LICENSE.md"
"url": "https://github.com/yahoo/strip-loader/blob/master/LICENSE.md"
}
],
"jshintConfig": {
Expand Down

0 comments on commit 3492700

Please sign in to comment.