# webpack-unused-files-plugin

> find ununsed files from your project

Latest version **1.0.7** (published 2018-05-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install webpack-unused-files-plugin
pnpm add webpack-unused-files-plugin
yarn add webpack-unused-files-plugin
bun add webpack-unused-files-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 | 1.0.7 |
| Published | 2018-05-21 |
| First published | 2018-05-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | mrkou47 |
| Maintainers | mrkou47 |
| Keywords | webpack, bundle, unused |

## Links

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

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [globby](https://npm.io/package/globby.md) ^8.0.1

## 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.7 (latest) — 2018-05-21
- 1.0.6 — 2018-05-18
- 1.0.4 — 2018-05-17
- 1.0.3 — 2018-05-17
- 1.0.1 — 2018-05-17
- 1.0.0 — 2018-05-17

## README

# webpack-unused-files-plugin

find unused files from your project.

<img src="https://preview.ibb.co/dFP6ko/2018_05_21_2_18_11.png" alt="2018_05_21_2_18_11" border="0">

## Usage

> yarn add webpack-unused-files-plugin

or

> npm install webpack-unused-files-plugin


```js
const WebpackUnusedFilesPlugin = require('webpack-unused-files-plugin');

// webpack config
module.exports = {
  plugins: [
    new WebpackUnusedFilesPlugin(options),
  ]
}
```

## Options

```js
const defaultOptions = {
  context: '',
  patterns: [
    "!**/node_modules",
    "!**/(test|tests)/**"
  ],
  sort: null, // 'ext', 'path'
  strict: false,
}
```

|options|type|describe|default|required|
|-- |-- |-- |-- |-- |
|context|string|target folder|webpack.context|false|
|patterns|[]string|glob patterns| `!**/node_modules !**/test` |false|
|sort|enum|how to display unused files, options `ext`, `path`
|strict|boolean|throw an error when plugin find unused file|false|false|


## Example

```js
config = {
  plugins: [
    new WebpackUnusedFilesPlugin({
      context: path.join(__dirname, 'src'), // find basic at src directory
      patterns: [ // NOTE: plugin will extend .gitignore
        "!**/*.log"
      ],
      sort: "ext", // plugin will sort unused file by file extenstion
      strict: true, // webpack compilcation build failed with an error
    }),
  ],
}
```

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