# webpack-filter-console-loader

> A webpack loader to filter console function

Latest version **1.0.0** (published 2023-08-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install webpack-filter-console-loader
pnpm add webpack-filter-console-loader
yarn add webpack-filter-console-loader
bun add webpack-filter-console-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-08-17 |
| First published | 2023-08-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | leo.chen |
| Maintainers | inconfident |
| Keywords | webpack |

## Links

- npm: https://www.npmjs.com/package/webpack-filter-console-loader
- npm.io page: https://npm.io/package/webpack-filter-console-loader

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-08-17

## README

# webpack-filter-console-loader

A webpack loader that filters out `console.log` statements. By default, it retains the logs added by the current Git user. However, you can specify other authors using the `allow` option.

## Installation

Using npm:

```bash
npm install webpack-filter-console-loader --save-dev
```

Or using yarn:

```bash
yarn add webpack-filter-console-loader --dev
```

## Usage

### Directly in Webpack Configuration:

```javascript
module: {
  rules: [
    {
      test: /\.js$/,
      use: 'webpack-filter-console-loader'
    }
  ]
}
```

### Using `configureWebpack` in Vue CLI:

In your `vue.config.js`:

```javascript
module.exports = {
  configureWebpack: {
    module: {
      rules: [
        {
          test: /\.js$/,
          use: 'webpack-filter-console-loader'
        }
      ]
    }
  }
}
```

### Using `chainWebpack` in Vue CLI:

In your `vue.config.js`:

```javascript
module.exports = {
  chainWebpack: config => {
    config.module
      .rule('js')
      .test(/\.js$/)
      .use('webpack-filter-console-loader')
      .loader('webpack-filter-console-loader')
      .end();
  }
}
```

## Options

### `allow` (Optional)

An array of git authors whose `console.log` statements should be retained in the code. If this option is not provided, the loader will retain only the `console.log` statements added by the current Git user.

Example:

```javascript
{
  loader: 'webpack-filter-console-loader',
  options: {
    allow: ['Author1', 'Author2']
  }
}
```

## License

[MIT](./LICENSE) (You can add a LICENSE file to your repository and link it here.)

---

---
_Source: https://npm.io/package/webpack-filter-console-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
