unreferenced-files-webpack-plugin
v1.0.1
Published
A Webpack plugin to detect and optionally delete unused (unreferenced) files in your project.
Maintainers
Readme
unreferenced-files-webpack-plugin
A Webpack plugin and CLI tool to detect (and optionally delete) files that are not referenced by your Webpack build.
🔧 Installation
npm install --save-dev unreferenced-files-webpack-plugin🧩 Usage in Webpack
const UnreferencedFilesPlugin = require('unreferenced-files-webpack-plugin');
module.exports = {
plugins: [
new UnreferencedFilesPlugin({
root: './src',
output: 'unreferenced-files.log',
outputJson: true,
autoDelete: false,
extensions: ['.js', '.vue', '.css', '.png']
})
]
};🖥️ Usage via CLI
node ./bin/cli.js --root ./src --extensions .js,.vue,.png --json --delete⚠️ Warning
Use --delete carefully — files will be removed from disk!
📄 License
MIT
