# unused-files-webpack-plugin

> Glob all files that are not compiled by webpack under webpack's context

Latest version **3.4.0** (published 2018-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install unused-files-webpack-plugin
pnpm add unused-files-webpack-plugin
yarn add unused-files-webpack-plugin
bun add unused-files-webpack-plugin
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.4.0 |
| Published | 2018-03-14 |
| First published | 2015-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/unused-files-webpack-plugin) |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 68.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 268 |
| Author | tomchentw |
| Maintainers | tomchentw |
| Keywords | unused, redundancy, files, require, webpack, webpack-plugin |

## Links

- npm: https://www.npmjs.com/package/unused-files-webpack-plugin
- Repository: https://github.com/tomchentw/unused-files-webpack-plugin
- Homepage: https://github.com/tomchentw/unused-files-webpack-plugin/
- Issues: https://github.com/tomchentw/unused-files-webpack-plugin/issues
- npm.io page: https://npm.io/package/unused-files-webpack-plugin

## Dependencies (5)

- [semver](https://npm.io/package/semver.md) ^5.5.0
- [warning](https://npm.io/package/warning.md) ^3.0.0
- [glob-all](https://npm.io/package/glob-all.md) ^3.1.0
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^7.0.0-beta.3
- [util.promisify](https://npm.io/package/util.promisify.md) ^1.0.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 3.4.0 (latest) — 2018-03-14
- 3.3.0 — 2018-03-14
- 3.2.0 — 2017-10-23
- 3.1.0 — 2017-10-21
- 3.0.2 — 2017-06-13
- 3.0.1 — 2017-02-13
- 3.0.0 — 2016-09-22
- 2.0.5 — 2016-09-20
- 2.0.4 — 2016-07-14
- 2.0.3 — 2016-05-30
- 2.0.2 — 2016-01-25
- 2.0.1 — 2016-01-22
- 2.0.0 — 2016-01-22
- 1.3.0 — 2015-09-07
- 1.2.0 — 2015-07-10
- … 2 more at https://npm.io/package/unused-files-webpack-plugin/versions

## README

# unused-files-webpack-plugin
> Glob all files that are not compiled by webpack under webpack's context

[![Version][npm-image]][npm-url] [![Travis CI][travis-image]][travis-url] [![Quality][codeclimate-maintainability-image]][codeclimate-maintainability-url] [![Coverage][codeclimate-c-image]][codeclimate-c-url] [![Dependencies][gemnasium-image]][gemnasium-url] [![Gitter][gitter-image]][gitter-url]

Install with npm:

```bash
npm i --save-dev unused-files-webpack-plugin
```

Install with yarn:

```bash
yarn add --dev unused-files-webpack-plugin
```

## Usage

### `webpack.config.babel.js`

```js
import UnusedFilesWebpackPlugin from "unused-files-webpack-plugin";

export default {
  plugins: [
    new UnusedFilesWebpackPlugin(options),
  ],
};
```

### `webpack.config.js`

```js
const { UnusedFilesWebpackPlugin } = require("unused-files-webpack-plugin");

module.exports = {
  plugins: [
    new UnusedFilesWebpackPlugin(options),
  ],
};
```


## Options

```js
new UnusedFilesWebpackPlugin(options)
```

### options.patterns

The (array of) pattern(s) to glob all files within the context.

* Default: `["**/*.*"]`
* Directly pass to [`glob-all(patterns)`](https://github.com/jpillora/node-glob-all#api)

### options.failOnUnused

Emit _error_ instead of _warning_ in webpack compilation result.

* Default: `false`
* Explicitly set it to `true` to enable this feature

### options.globOptions

The options object pass to second parameter of `glob-all`.

* Default: `{ignore: "node_modules/**/*"}`
* Directly pass to [`glob-all(pattern, globOptions)`](https://github.com/jpillora/node-glob-all#api), which then pass to [`glob(…, globOptions)`](https://github.com/isaacs/node-glob#options)

#### globOptions.ignore

Ignore pattern for glob. Can be a String or an Array of String.

* Default: `"node_modules/**/*"`
* Pass to: [`options.ignore`](https://github.com/isaacs/node-glob#options)

#### globOptions.cwd

Current working directory for glob. If you don't set explicitly, it defaults to the `context` specified by your webpack compiler at runtime.

* Default: `webpackCompiler.context`
* Pass to: [`options.cwd`](https://github.com/isaacs/node-glob#options)
* See also: [`context` in webpack](https://webpack.js.org/configuration/entry-context/#context)


## Contributing

[![devDependency Status][david-dm-image]][david-dm-url]

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


[npm-image]: https://img.shields.io/npm/v/unused-files-webpack-plugin.svg?style=flat-square
[npm-url]: https://www.npmjs.org/package/unused-files-webpack-plugin

[travis-image]: https://img.shields.io/travis/tomchentw/unused-files-webpack-plugin.svg?style=flat-square
[travis-url]: https://travis-ci.org/tomchentw/unused-files-webpack-plugin
[codeclimate-maintainability-image]: https://img.shields.io/codeclimate/maintainability/tomchentw/unused-files-webpack-plugin.svg?style=flat-square
[codeclimate-maintainability-url]: https://codeclimate.com/github/tomchentw/unused-files-webpack-plugin
[codeclimate-c-image]: https://img.shields.io/codeclimate/c/tomchentw/unused-files-webpack-plugin.svg?style=flat-square
[codeclimate-c-url]: https://codeclimate.com/github/tomchentw/unused-files-webpack-plugin
[gemnasium-image]: https://img.shields.io/gemnasium/tomchentw/unused-files-webpack-plugin.svg?style=flat-square
[gemnasium-url]: https://gemnasium.com/tomchentw/unused-files-webpack-plugin
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/tomchentw/unused-files-webpack-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[david-dm-image]: https://img.shields.io/david/dev/tomchentw/unused-files-webpack-plugin.svg?style=flat-square
[david-dm-url]: https://david-dm.org/tomchentw/unused-files-webpack-plugin#info=devDependencies

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