Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrkou47/webpack-unused-files-plugin
find unused files from your project.
https://github.com/mrkou47/webpack-unused-files-plugin
Last synced: about 1 month ago
JSON representation
find unused files from your project.
- Host: GitHub
- URL: https://github.com/mrkou47/webpack-unused-files-plugin
- Owner: MrKou47
- License: mit
- Created: 2018-05-17T10:25:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T09:01:53.000Z (about 3 years ago)
- Last Synced: 2024-11-28T18:43:01.407Z (about 1 month ago)
- Language: JavaScript
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webpack-unused-files-plugin
find unused files from your project.
## 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
}),
],
}
```