{"_id":"@barretter/remove-unused-files-webpack-plugin","_rev":"4-605e518f2db69431221c104ea5ce7ca2","name":"@barretter/remove-unused-files-webpack-plugin","dist-tags":{"latest":"4.0.2"},"versions":{"3.5.0":{"name":"@barretter/remove-unused-files-webpack-plugin","version":"3.5.0","keywords":["remove","unused","redundancy","files","require","webpack","webpack-plugin"],"author":{"url":"https://github.com/Barretem","name":"barretem","email":"1178310248@qq.com"},"license":"MIT","_id":"@barretter/remove-unused-files-webpack-plugin@3.5.0","maintainers":[{"name":"barretem","email":"1178310248@qq.com"}],"homepage":"https://github.com/Barretem/unused-files-webpack-plugin/","bugs":{"url":"https://github.com/Barretem/unused-files-webpack-plugin/issues"},"dist":{"shasum":"401eb977ff09b2d41baa0248f5924871b347470f","tarball":"https://registry.npmjs.org/@barretter/remove-unused-files-webpack-plugin/-/remove-unused-files-webpack-plugin-3.5.0.tgz","fileCount":19,"integrity":"sha512-lI4PW2dat1ZtztWrLYUg957I0yQjAga1p3fvQXjg2pAPh2CR45C4+uDi3bP9pdJE3SEd2B2hmNyKmPtvK6B2qg==","signatures":[{"sig":"MEUCIEAve2/EoyJ0KBzgW6S5wkagISiNS3lxg8fj4GApS9TRAiEAmbKfIOdh8YbhyfqQxOC3rDtAVjBSzGGPWBHzd3J8sHI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116668},"jest":{"testPathIgnorePatterns":["\\d+\\.\\d+\\.\\d+"]},"main":"lib/index.js","babel":{"env":{"test":{"presets":[["env"]]}},"plugins":["transform-object-rest-spread"]},"gitHead":"90cc6deb0373eeadcdf1e3ab908fd032288837ff","scripts":{"test":"jest","release":"standard-version -m 'chore(release): %s \n\n* CHANGELOG: https://github.com/Barretem/unused-files-webpack-plugin/blob/v%s/CHANGELOG.md'","build:lib":"babel-multi-env --multi-versions 8.0.0,6.0.0,4.0.0,0.12.0,0.10.0 --out-dir lib 'src/**/*.js'","precommit":"lint-staged","commit:lib":"git add -A && git commit -m 'chore(lib): compile from src with `babel-multi-env`'","prerelease":"npm run commit:lib","prebuild:lib":"rimraf lib","precommit:lib":"npm run build:lib"},"_npmUser":{"name":"barretem","email":"1178310248@qq.com"},"repository":{"url":"git+https://github.com/Barretem/unused-files-webpack-plugin.git","type":"git"},"_npmVersion":"6.14.11","description":"Glob all files that are not compiled by webpack under webpack's context","directories":{},"lint-staged":{"*.{js,jsx,json,css}":["prettier --write","git add"]},"_nodeVersion":"12.21.0","dependencies":{"semver":"^5.5.0","warning":"^3.0.0","fs-extra":"^10.0.0","glob-all":"^3.1.0","babel-runtime":"^7.0.0-beta.3","util.promisify":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^21.3.0-beta.2","husky":"^0.14.3","rimraf":"^2.6.2","webpack":"^3.8.1","prettier":"^1.11.1","memory-fs":"^0.4.1","babel-core":"^7.0.0-beta.3","lint-staged":"^7.0.0","babel-multi-env":"^0.4.0","babel-preset-env":"^7.0.0-beta.3","standard-version":"^4.3.0","babel-plugin-transform-runtime":"^7.0.0-beta.3","babel-plugin-transform-object-rest-spread":"^7.0.0-beta.3"},"_npmOperationalInternal":{"tmp":"tmp/remove-unused-files-webpack-plugin_3.5.0_1633946757404_0.4852963109180968","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@barretter/remove-unused-files-webpack-plugin","version":"4.0.0","keywords":["remove","unused","redundancy","files","require","webpack","webpack5","webpack-plugin"],"author":{"url":"https://github.com/Barretem","name":"barretem","email":"1178310248@qq.com"},"license":"MIT","_id":"@barretter/remove-unused-files-webpack-plugin@4.0.0","maintainers":[{"name":"barretem","email":"1178310248@qq.com"}],"homepage":"https://github.com/Barretem/unused-files-webpack-plugin/","bugs":{"url":"https://github.com/Barretem/unused-files-webpack-plugin/issues"},"dist":{"shasum":"e4e820d24fa8b31ddcf24a8fd37c61c989586b0a","tarball":"https://registry.npmjs.org/@barretter/remove-unused-files-webpack-plugin/-/remove-unused-files-webpack-plugin-4.0.0.tgz","fileCount":10,"integrity":"sha512-daqyHZGrqjJKQXXB4nR/t417DnNcEyU3A9WtwO6QRgRbqm4lV5B/URVekJA9ZB+sPXMC7xJXC7K+vVIvRD3LJA==","signatures":[{"sig":"MEUCIQCjGyf13YcpJa19byw60nRn1mAc5tpSayfBQhZLg9CBXAIgGfgRAd/nBhjud5YaGI8k8vEbBAOzc4/mTGFT19tGyYI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28796},"main":"dist/index.js","_from":"file:barretter-remove-unused-files-webpack-plugin-4.0.0.tgz","scripts":{"dev":"tsc --watch","lint":"eslint ./src --ext .js,.ts","test":"vitest","build":"tsc src/*.ts --outDir dist","version":"changeset version","webpack":"webpack --config ./example/webpack.config.js","changeset":"changeset"},"_npmUser":{"name":"barretem","email":"1178310248@qq.com"},"prettier":{"singleQuote":true},"_resolved":"/private/var/folders/t3/y3vftssd78x9ntc1bs2t25km0000gn/T/00443dbea1c4612cee4183c2308a8e44/barretter-remove-unused-files-webpack-plugin-4.0.0.tgz","_integrity":"sha512-daqyHZGrqjJKQXXB4nR/t417DnNcEyU3A9WtwO6QRgRbqm4lV5B/URVekJA9ZB+sPXMC7xJXC7K+vVIvRD3LJA==","repository":{"url":"git+https://github.com/Barretem/unused-files-webpack-plugin.git","type":"git"},"_npmVersion":"10.7.0","description":"Glob all files that are not compiled by webpack under webpack's context","directories":{},"lint-staged":{"*.{ts,tsx}":["prettier --parser typescript --write","npm run lint","git add"],"*.{js,json,css,md}":["prettier --write","git add"]},"_nodeVersion":"20.15.1","dependencies":{"fs-extra":"^11.3.0","fast-glob":"^3.3.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^9.19.0","vitest":"^3.0.5","webpack":"^5.97.1","prettier":"^3.4.2","memory-fs":"^0.5.0","typescript":"^5.7.3","lint-staged":"^15.4.2","webpack-cli":"^6.0.1","@types/webpack":"^5.28.5","@changesets/cli":"^2.27.12","@types/fs-extra":"^11.0.4","eslint-config-xo":"^0.46.0","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.3","@typescript-eslint/parser":"^8.21.0","eslint-plugin-no-explicit-type-exports":"^0.12.1"},"peerDependencies":{"webpack":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remove-unused-files-webpack-plugin_4.0.0_1738886323378_0.32362755336676985","host":"s3://npm-registry-packages-npm-production"}},"4.0.1":{"name":"@barretter/remove-unused-files-webpack-plugin","version":"4.0.1","keywords":["remove","unused","redundancy","files","require","webpack","webpack5","webpack-plugin"],"author":{"url":"https://github.com/Barretem","name":"barretem","email":"1178310248@qq.com"},"license":"MIT","_id":"@barretter/remove-unused-files-webpack-plugin@4.0.1","maintainers":[{"name":"barretem","email":"1178310248@qq.com"}],"homepage":"https://github.com/Barretem/unused-files-webpack-plugin/","bugs":{"url":"https://github.com/Barretem/unused-files-webpack-plugin/issues"},"dist":{"shasum":"a16216826d19ad07d0265cf11666f2ba357f0abb","tarball":"https://registry.npmjs.org/@barretter/remove-unused-files-webpack-plugin/-/remove-unused-files-webpack-plugin-4.0.1.tgz","fileCount":15,"integrity":"sha512-VEtUwVkeKH3CT24x9MIq/UDM84UFhF34WYj4A9n4vxnNFTE1EMlcy0ou1IhN3xa5fCVeeLZeDudSrW6CjD5p0g==","signatures":[{"sig":"MEUCIQC7o1LqlIGkXKcovCY4L+swhWnxxMZkS21WboZFPaZn7QIgPMrkxnzbAC9DZFrm5TZ7aR+pPTqxGb1p1dhma+ehI30=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32499},"main":"dist/index.js","_from":"file:barretter-remove-unused-files-webpack-plugin-4.0.1.tgz","types":"dist/index.d.ts","scripts":{"dev":"tsc --watch","lint":"eslint ./src --ext .js,.ts","test":"vitest","build":"rimraf dist & tsc","version":"changeset version","webpack":"webpack --config ./example/webpack.config.js","changeset":"changeset"},"_npmUser":{"name":"barretem","email":"1178310248@qq.com"},"prettier":{"singleQuote":true},"_resolved":"/private/var/folders/t3/y3vftssd78x9ntc1bs2t25km0000gn/T/0ba94b3b25f767b69bea113369731ae3/barretter-remove-unused-files-webpack-plugin-4.0.1.tgz","_integrity":"sha512-VEtUwVkeKH3CT24x9MIq/UDM84UFhF34WYj4A9n4vxnNFTE1EMlcy0ou1IhN3xa5fCVeeLZeDudSrW6CjD5p0g==","repository":{"url":"git+https://github.com/Barretem/unused-files-webpack-plugin.git","type":"git"},"_npmVersion":"10.7.0","description":"Glob all files that are not compiled by webpack under webpack's context","directories":{},"lint-staged":{"*.{ts,tsx}":["prettier --parser typescript --write","npm run lint","git add"],"*.{js,json,css,md}":["prettier --write","git add"]},"_nodeVersion":"20.15.1","dependencies":{"fs-extra":"^11.3.0","fast-glob":"^3.3.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^9.19.0","rimraf":"^6.0.1","vitest":"^3.0.5","webpack":"^5.97.1","prettier":"^3.4.2","memory-fs":"^0.5.0","typescript":"^5.7.3","lint-staged":"^15.4.2","webpack-cli":"^6.0.1","@types/webpack":"^5.28.5","@changesets/cli":"^2.27.12","@types/fs-extra":"^11.0.4","eslint-config-xo":"^0.46.0","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.3","@typescript-eslint/parser":"^8.21.0","eslint-plugin-no-explicit-type-exports":"^0.12.1"},"peerDependencies":{"webpack":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remove-unused-files-webpack-plugin_4.0.1_1739747555090_0.9220007574538094","host":"s3://npm-registry-packages-npm-production"}},"4.0.2":{"name":"@barretter/remove-unused-files-webpack-plugin","version":"4.0.2","description":"Glob all files that are not compiled by webpack under webpack's context","license":"MIT","author":{"name":"barretem","email":"1178310248@qq.com","url":"https://github.com/Barretem"},"repository":{"type":"git","url":"git+https://github.com/Barretem/unused-files-webpack-plugin.git"},"bugs":{"url":"https://github.com/Barretem/unused-files-webpack-plugin/issues"},"homepage":"https://github.com/Barretem/unused-files-webpack-plugin/","main":"dist/index.js","types":"dist/index.d.ts","keywords":["remove","unused","redundancy","files","require","webpack","webpack5","webpack-plugin"],"peerDependencies":{"webpack":">=5.0.0"},"devDependencies":{"@changesets/cli":"^2.27.12","@types/fs-extra":"^11.0.4","@types/webpack":"^5.28.5","@typescript-eslint/parser":"^8.21.0","eslint":"^9.19.0","eslint-config-prettier":"^10.0.1","eslint-config-xo":"^0.46.0","eslint-plugin-no-explicit-type-exports":"^0.12.1","eslint-plugin-prettier":"^5.2.3","husky":"^9.1.7","lint-staged":"^15.4.2","memory-fs":"^0.5.0","prettier":"^3.4.2","rimraf":"^6.0.1","typescript":"^5.7.3","vitest":"^3.0.5","webpack":"^5.97.1","webpack-cli":"^6.0.1"},"lint-staged":{"*.{js,json,css,md}":["prettier --write","git add"],"*.{ts,tsx}":["prettier --parser typescript --write","npm run lint","git add"]},"prettier":{"singleQuote":true},"dependencies":{"fast-glob":"^3.3.3","fs-extra":"^11.3.0"},"publishConfig":{"access":"public"},"scripts":{"build":"rimraf dist & tsc","dev":"tsc --watch","lint":"eslint ./src --ext .js,.ts","test":"vitest","changeset":"changeset","version":"changeset version","webpack":"webpack --config ./example/webpack.config.js"},"_id":"@barretter/remove-unused-files-webpack-plugin@4.0.2","_integrity":"sha512-+8im4XWDNjPp53sk23VwnJ0oO4BNhOyct8W/QenOJnPY/tHo5kLY+XZXALXmAIBe/eouwMFyNUeRH7YatGit4Q==","_resolved":"/private/var/folders/t3/y3vftssd78x9ntc1bs2t25km0000gn/T/86cfcd3861bc7c64cbca530a19d5e42c/barretter-remove-unused-files-webpack-plugin-4.0.2.tgz","_from":"file:barretter-remove-unused-files-webpack-plugin-4.0.2.tgz","_nodeVersion":"20.15.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-+8im4XWDNjPp53sk23VwnJ0oO4BNhOyct8W/QenOJnPY/tHo5kLY+XZXALXmAIBe/eouwMFyNUeRH7YatGit4Q==","shasum":"8595babe66e1cdebdf948517b6f17e0d76b8c24a","tarball":"https://registry.npmjs.org/@barretter/remove-unused-files-webpack-plugin/-/remove-unused-files-webpack-plugin-4.0.2.tgz","fileCount":15,"unpackedSize":32235,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHbYAwCu7kPf2A7CK7bs+4g9SoOlddkmVGRpKab2tmUBAiB1SF9ToTaQEkGDDGMOzJiaNSXDukG63fb82wJvFQw28A=="}]},"_npmUser":{"name":"barretem","email":"1178310248@qq.com"},"directories":{},"maintainers":[{"name":"barretem","email":"1178310248@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remove-unused-files-webpack-plugin_4.0.2_1739748186785_0.21911504391825032"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-11T10:05:57.356Z","modified":"2025-02-16T23:23:07.152Z","3.5.0":"2021-10-11T10:05:57.559Z","4.0.0":"2025-02-06T23:58:43.582Z","4.0.1":"2025-02-16T23:12:35.296Z","4.0.2":"2025-02-16T23:23:06.960Z"},"bugs":{"url":"https://github.com/Barretem/unused-files-webpack-plugin/issues"},"author":{"name":"barretem","email":"1178310248@qq.com","url":"https://github.com/Barretem"},"license":"MIT","homepage":"https://github.com/Barretem/unused-files-webpack-plugin/","keywords":["remove","unused","redundancy","files","require","webpack","webpack5","webpack-plugin"],"repository":{"type":"git","url":"git+https://github.com/Barretem/unused-files-webpack-plugin.git"},"description":"Glob all files that are not compiled by webpack under webpack's context","maintainers":[{"name":"barretem","email":"1178310248@qq.com"}],"readme":"# remove-unused-files-webpack-plugin\n\nThis plugin only supports webpack versions above 4.\n\n> fork from unused-files-webpack-plugin。The main extension is to remove unused files.\n\n[![Version][npm-image]][npm-url]\n\nInstall with npm:\n\n```bash\nnpm i --save-dev @barretter/remove-unused-files-webpack-plugin\n```\n\nInstall with yarn:\n\n```bash\nyarn add --dev @barretter/remove-unused-files-webpack-plugin\n```\n\n## Usage\n\n### `webpack.config.babel.js`\n\n```js\nimport RemoveUnusedFilesWebpackPlugin from \"@barretter/remove-unused-files-webpack-plugin\";\n\nexport default {\n  plugins: [\n    new RemoveUnusedFilesWebpackPlugin(options),\n  ],\n};\n```\n\n### `webpack.config.js`\n\n```js\nconst RemoveUnusedFilesWebpackPlugin = require(\"@barretter/remove-unused-files-webpack-plugin\").default;\n\nmodule.exports = {\n  plugins: [\n    new RemoveUnusedFilesWebpackPlugin(options),\n  ],\n};\n```\n\n\n## Options\n\n```js\nnew RemoveUnusedFilesWebpackPlugin(options)\n```\n\n### options.include\n\nThe (array of) pattern(s) to glob all files within the context.\n\n* Default: `[\"src/**/*.*\"]`\n* Directly pass to [`fast-glob(patterns)`](https://github.com/mrmlnc/fast-glob#patterns-1)\n\n\n### options.exclude\n\nIgnore pattern for glob. Can be a String or an Array of String.\n\n* Default: `\"node_modules/**/*\"`\n* Pass to: [`fast-glob(ignore)`](https://github.com/mrmlnc/fast-glob#ignore)\n\n### options.failOnUnused\n\nEmit _error_ instead of _warning_ in webpack compilation result.\n\n* Default: `false`\n* Explicitly set it to `true` to enable this feature\n\n### options.globOptions\n\nThe options object pass to second parameter of `fast-glob`.\n\n* Default: `{ignore: \"node_modules/**/*\"}`\n* Directly pass to [`fast-glob(pattern, globOptions)`](https://github.com/mrmlnc/fast-glob#api), which then pass to [`glob(…, globOptions)`](https://github.com/mrmlnc/fast-glob#options-3)\n\n#### globOptions.cwd\n\nCurrent working directory for glob. If you don't set explicitly, it defaults to the `context` specified by your webpack compiler at runtime.\n\n* Default: `webpackCompiler.context`\n* Pass to: [`fast-glob(options.cwd)`](https://github.com/mrmlnc/fast-glob#cwd)\n* See also: [`context` in webpack](https://webpack.js.org/configuration/entry-context/#context)\n\n#### backupOptions.remove\n\nWhether to move unused files to the backup folder. Use this feature with caution.\n\n* Default: `false`\n* Explicitly set it to `true` to enable this feature\n\n#### backupOptions.dirPath\n\nBackup folder Path.\n\n* Default: `./.backup`\n* Only removeToBackup configuration to be `true`, This configuration item is valid.\n\n#### backupOptions.dirname\n\nBackup folder name.\n\n* Default: `The time when you run this plugin`\n* Only removeToBackup configuration to be `true`, This configuration item is valid.\n\n#### backupOptions.overwrite\n\nWhether to overwrite older files when the backup folder exit the same file\n\n* Default: `false`\n* Explicitly set it to `true` to enable this feature\n* Only removeToBackup configuration to be `true`, This configuration item is valid.\n\n## v3 to v4\n\n1. @barretter/remove-unused-files-webpack-plugin@^4.0.0 only support webpack 4+;\n2. This plugin api change from v3 to v4\n    - options.patterns -> options.include\n    - globOptions.ignore -> options.exclude\n    - The value of `options.globOptions` has been changed from `glob-all` to `fast-glob`.\n    - options.removeToBackup -> backupOptions.remove\n    - backupOptions.backUpDirPath -> backupOptions.dirPath\n    - backupOptions.backUpDirname -> backupOptions.dirname\n\n## Contributing\n\n[![devDependency Status][david-dm-image]][david-dm-url]\n\n1. Fork it\n2. Create your feature branch (`git checkout -b feature/my-new-feature`)\n3. Commit your changes (`git commit -am 'feat: Add some feature'`)\n4. Push to the branch (`git push origin feature/my-new-feature`)\n5. Create new Pull Request\n\n\n[npm-image]: https://img.shields.io/npm/v/@barretter/remove-unused-files-webpack-plugin.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/@barretter/remove-unused-files-webpack-plugin\n","readmeFilename":"README.md"}