{"id":28220137,"url":"https://github.com/allexcd/webpack-clean","last_synced_at":"2025-06-11T13:32:06.103Z","repository":{"id":1308510,"uuid":"42057924","full_name":"allexcd/webpack-clean","owner":"allexcd","description":"A webpack plugin to clean specified files after build","archived":false,"fork":false,"pushed_at":"2022-06-12T14:10:20.000Z","size":633,"stargazers_count":10,"open_issues_count":12,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-18T04:14:39.055Z","etag":null,"topics":["webpack-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allexcd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-07T14:39:31.000Z","updated_at":"2022-08-10T04:58:20.000Z","dependencies_parsed_at":"2022-08-16T13:05:05.356Z","dependency_job_id":null,"html_url":"https://github.com/allexcd/webpack-clean","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allexcd%2Fwebpack-clean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allexcd%2Fwebpack-clean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allexcd%2Fwebpack-clean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allexcd%2Fwebpack-clean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allexcd","download_url":"https://codeload.github.com/allexcd/webpack-clean/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allexcd%2Fwebpack-clean/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259273979,"owners_count":22832442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["webpack-plugin"],"created_at":"2025-05-18T04:14:33.342Z","updated_at":"2025-06-11T13:32:06.095Z","avatar_url":"https://github.com/allexcd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub stars](https://img.shields.io/github/stars/allexcd/webpack-clean.svg?style=flat-square)](https://github.com/allexcd/webpack-clean/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/allexcd/webpack-clean.svg?style=flat-square)](https://github.com/allexcd/webpack-clean/network)\n[![GitHub issues](https://img.shields.io/github/issues/allexcd/webpack-clean.svg?style=flat-square)](https://github.com/allexcd/webpack-clean/issues)\n[![GitHub issues closed](https://img.shields.io/github/issues-closed/allexcd/webpack-clean.svg?style=flat-square)](https://github.com/allexcd/webpack-clean/issues?q=is%3Aissue+is%3Aclosed)\n\n[![Github release date](https://img.shields.io/github/release-date/allexcd/webpack-clean.svg?style=flat-square)](https://github.com/allexcd/webpack-clean/releases)\n[![Github release version](https://img.shields.io/github/release/allexcd/webpack-clean.svg?style=flat-square)](https://github.com/allexcd/webpack-clean/releases)\n[![npm release version](https://img.shields.io/npm/v/webpack-clean.svg?style=flat-square)](https://nodei.co/npm/webpack-clean)\n[![Github commits since last release](https://img.shields.io/github/commits-since/allexcd/webpack-clean/latest.svg?style=flat-square)](https://www.npmjs.com/package/webpack-clean)\n\n[![npm](https://nodei.co/npm/webpack-clean.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/webpack-clean)\n\n[![npm monthly downloads](https://img.shields.io/npm/dm/webpack-clean.svg?style=flat-square)](https://www.npmjs.com/package/webpack-clean)\n[![npm yearly downloads](https://img.shields.io/npm/dy/webpack-clean.svg?style=flat-square)](https://www.npmjs.com/package/webpack-clean)\n\n[![license](https://img.shields.io/github/license/allexcd/webpack-clean.svg?style=flat-square)](https://github.com/allexcd/webpack-clean/blob/master/LICENSE)\n\n##### CI Status:\n\n[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/allexcd_marketplace/webpack-clean%2Fmaster?type=cf-1)]( https%3A%2F%2Fg.codefresh.io%2Fpublic%2Faccounts%2Fallexcd_marketplace%2Fpipelines%2F5ea80cd06a6a4c392b40b192)\n\n## Webpack Clean\n\nA webpack plugin to clean specified files after build\n\n### Getting started\n\nInstall the plugin:\n\n```\nnpm install webpack-clean --save-dev\nyarn add webpack-clean --dev\n```\n\n\n### API\n```javascript\nnew WebpackCleanPlugin(files: array|string, [ { [basePath: string], [removeMaps: boolean] } ])\n```\n\n* `files` - array of files or string for a single file relative to the `basePath` or to the `context` of your config (if the `basePath` param is not specified),\n* `basePath` (optional) - string - directory to be resolved to\n* `removeMaps` (optional) - boolean - specify if the `.map` files should be automatically removed. Disabled by default.\n* `forceDelete` (optional) - boolean - specify if the files should be force deleted in case of compile errors. If `forceDelete` is not enabled, the compile errors will be logged to `stdout` but the deletion of the files will not take place. Disabled by default.\n\n### Usage\n\n```javascript\nvar WebpackCleanPlugin = require('webpack-clean');\n\nmodule.exports = {\n    context: path.join(__dirname, './'),\n    entry: './src/index.js',\n    output: {\n        filename: 'bundle.js',\n        path: path.resolve(__dirname, 'dist')\n    },\n    plugins: [\n        new WebpackCleanPlugin([\n            'dist/test1.js',\n            'dist/test2.js'\n        ])\n    ]\n};\n\nmodule.exports = {\n    plugins: [\n        new WebpackCleanPlugin(\n            'dist/fileA.js',\n            {basePath: path.join(__dirname, './')}\n        )\n    ]\n};\n\nmodule.exports = {\n    plugins: [\n        new WebpackCleanPlugin([\n            'fileA.js',\n            'fileB.js'\n        ], {basePath: path.join(__dirname, 'dist'))}\n    ]\n};\n\nmodule.exports = {\n    plugins: [\n        new WebpackCleanPlugin([\n            'fileA.js',\n            'fileB.js'\n        ], {basePath: path.join(__dirname, 'dist'), removeMaps: true)}\n    ]\n};\n\nmodule.exports = {\n    plugins: [\n        new WebpackCleanPlugin([\n            'fileA.js',\n            'fileB.js'\n        ], {basePath: path.join(__dirname, 'dist'), removeMaps: true, forceDelete: true)}\n    ]\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallexcd%2Fwebpack-clean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallexcd%2Fwebpack-clean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallexcd%2Fwebpack-clean/lists"}