# ignore-emit-webpack-plugin

> Prevents ignored files from being emitted during a Webpack build

Latest version **2.0.6** (published 2020-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ignore-emit-webpack-plugin
pnpm add ignore-emit-webpack-plugin
yarn add ignore-emit-webpack-plugin
bun add ignore-emit-webpack-plugin
```

## 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 | 2.0.6 |
| Published | 2020-11-23 |
| First published | 2017-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | mrbar42 |
| Maintainers | mrbar42 |
| Keywords | webpack, plugin, ignore, emit, asset, assets |

## Links

- npm: https://www.npmjs.com/package/ignore-emit-webpack-plugin
- Repository: https://github.com/mrbar42/ignore-emit-webpack-plugin
- Homepage: https://github.com/mrbar42/ignore-emit-webpack-plugin#readme
- Issues: https://github.com/mrbar42/ignore-emit-webpack-plugin/issues
- npm.io page: https://npm.io/package/ignore-emit-webpack-plugin

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 2.0.6 (latest) — 2020-11-23
- 2.0.5 — 2020-11-04
- 2.0.4 — 2020-10-28
- 2.0.3 — 2020-08-24
- 2.0.2 — 2019-07-08
- 2.0.1 — 2019-07-08
- 1.0.2 — 2018-07-02
- 1.0.1 — 2018-06-20
- 0.2.1 — 2017-07-08
- 0.2.0 — 2017-07-08

## README

# Ignore Emit Webpack plugin

[![Build Status](https://travis-ci.org/mrbar42/ignore-emit-webpack-plugin.svg?branch=master)](https://travis-ci.org/mrbar42/ignore-emit-webpack-plugin)

Prevent files that are matching a pattern from being emitted in a webpack build.
This is achieved with a webpack plugin.

You can easily ignore file by accident - use with care.

## Quick Usage

```sh
npm i --save-dev ignore-emit-webpack-plugin

```
Typescript
```typescript
// webpack.config.js
import IgnoreEmitPlugin from 'ignore-emit-webpack-plugin';

export default {
  // ...
  plugins: [
    new IgnoreEmitPlugin(/\.map$/)
  ]
};
```

JS
```js
// webpack.config.js
const IgnoreEmitPlugin = require('ignore-emit-webpack-plugin');

module.exports = {
  // ...
  plugins: [ new IgnoreEmitPlugin(/\.map$/) ]
  // ...
};
```

The module is written in Node 8.x flavored es6.
To get the es5 transpiled version use `require('ignore-emit-webpack-plugin/es5')`

## Usage

Signature: `new IgnoreEmitPlugin(patterns, options)`


- **patterns** `{RegExp|string|Array.<RegExp|string>}` - regex, string or array with mixed regex/strings (deep nesting allowed),
to match against the **OUTPUT** path of assets.
- **options** `{object}` - optional, options object
   - options.debug `{boolean}` - prints extra logs

not defining patterns or defining invalid pattern will throw error.

```js
// single regex
new IgnoreEmitPlugin(/\/artifacy.js$/);
// single regex in array
new IgnoreEmitPlugin([ /\/artifacy.js$/ ]);
// mixed array
new IgnoreEmitPlugin([ 'file.woff', /\/artifacy.js$/ ]);

// you can also do this - but you really shouldn't
new IgnoreEmitPlugin([ [ [ [ /\/artifacy.js$/ ] ] ] ]);


// file.js
// dir/file.js

new IgnoreEmitPlugin('file.js');     // both file.js and dir/file.js ignored
new IgnoreEmitPlugin(/\/file\.js/);  // only dir/file.js is ignored
new IgnoreEmitPlugin(/^file\.js/);   // only file.js is ignored
```

## I want to help!

Contribution would be much appreciated.
Either by creating pull requests of opening issues.

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