{"id":22619824,"url":"https://github.com/simonkovtyk/esbuild-plugin-cleanup","last_synced_at":"2026-02-05T21:03:22.312Z","repository":{"id":257011722,"uuid":"857148143","full_name":"simonkovtyk/esbuild-plugin-cleanup","owner":"simonkovtyk","description":"By deleting the out folder before each new build, the plugin ensures a clean output directory for the build process.","archived":false,"fork":false,"pushed_at":"2024-09-29T16:04:58.000Z","size":24,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T17:58:15.856Z","etag":null,"topics":["build-cleaner","clean-buildfiles","cleanup","cleanup-build","cleanup-script","cleanup-tool","esbuild","esbuild-plugin","esbuild-plugins","out-clean","out-cleanup","output-clean"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/simonkovtyk.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-13T22:54:16.000Z","updated_at":"2024-12-28T15:31:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f62101f-5664-449c-a9a5-eb349812980c","html_url":"https://github.com/simonkovtyk/esbuild-plugin-cleanup","commit_stats":null,"previous_names":["simonkovtyk/esbuild-plugin-cleanup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simonkovtyk/esbuild-plugin-cleanup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-cleanup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-cleanup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-cleanup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-cleanup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonkovtyk","download_url":"https://codeload.github.com/simonkovtyk/esbuild-plugin-cleanup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-cleanup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29134243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T20:50:26.975Z","status":"ssl_error","status_checked_at":"2026-02-05T20:49:26.082Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["build-cleaner","clean-buildfiles","cleanup","cleanup-build","cleanup-script","cleanup-tool","esbuild","esbuild-plugin","esbuild-plugins","out-clean","out-cleanup","output-clean"],"created_at":"2024-12-08T22:09:13.482Z","updated_at":"2026-02-05T21:03:19.703Z","avatar_url":"https://github.com/simonkovtyk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg width=\"196\" src=\"https://raw.githubusercontent.com/simonkovtyk/esbuild-plugin-cleanup/dc83c066041721f2e0b6a41c1b02d1aa2c6cd3c1/docs/esbuild-favicon.svg\" /\u003e\n\n\u003ch1\u003eCleanup Plugin\u003c/h1\u003e\n\n\u003cp\u003eBy deleting the out folder before each new build, the plugin ensures a clean output directory for the build process.\u003c/p\u003e\n\n![NPM Downloads](https://img.shields.io/npm/dw/esbuild-plugin-cleanup)\n![NPM License](https://img.shields.io/npm/l/esbuild-plugin-package-json)\n![GitHub package.json version](https://img.shields.io/npm/v/esbuild-plugin-cleanup)\n![TypeScript types](https://img.shields.io/badge/TypeScript_types-included-blue)\n\n\u003cbr /\u003e\n\nAdd a ⭐ to this repository — *it motivates me a lot!*\n\n\u003c/div\u003e\n\n## ⚡️ Getting started\n\nSimply install this package with your package manager.\n\n````shell\nnpm install -D esbuild-plugin-cleanup\n````\n\n\u003cdetails\u003e\n\u003csummary\u003e📦 other package manager\u003c/summary\u003e\n\nHere are examples for installing the package with other package manager.\n\n\u003e 💾 **yarn**\n\u003e ````shell\n\u003e yarn add -D esbuild-plugin-cleanup\n\u003e ````\n\n\u003e 💾 **pnpm**\n\u003e ````shell\n\u003e pnpm install -D esbuild-plugin-cleanup\n\u003e ````\n\n\u003c/details\u003e\n\nLooks good so far 🔥 — now you have installed the latest version!\n\n## 💡 Introduction\n\nThis esbuild plugin automatically deletes the previous build before generating a new one, keeping your output directory clean.\n\nIt runs a pre-build cleanup step to prevent outdated files from cluttering your project. With minimal configuration, it simplifies workflows and ensures only the latest assets remain.\n\n## 🔧 Usage\n\n```typescript\ncleanupPlugin(options);\n```\n\nThis function needs to be called inside the esbuild configuration in order to use this plugin. It will provide the plugin inside the build process of esbuild.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example of the integration\u003c/summary\u003e\n\n````typescript\nesbuild.build({\n  // some configuration...\n  plugins: [\n    cleanupPlugin();\n    // more plugins here...\n  ]\n})\n````\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example of the configuration\u003c/summary\u003e\n\n````typescript\ncleanupPlugin({\n  // configure here\n});\n````\n\n\u003c/details\u003e\n\n### Properties\n\n#### ``overrideOut``\n\n\u003e Default: ``undefined`` (esbuild's output directory)\n\nA ``string``, that specifies the output directory, that'll be cleaned up.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example\u003c/summary\u003e\n\n````typescript\ncleanupPlugin({\n  overrideOut: \"dist\" // any directory allowed\n});\n````\n\n\u003c/details\u003e\n\n### Returns\n\nType: ``Plugin``\n\nAn instance of this plugin, that will be used by esbuild automatically.\n\n## License\n\nThe MIT License (MIT) - Please have a look at the [License](https://github.com/simonkovtyk/esbuild-plugin-cleanup/blob/main/LICENSE) file for more details.\n\n## Contributing\n\nWant to contribute to an open-source project on GitHub but unsure where to start? Check out this comprehensive step-by-step guide on how to contribute effectively!\n\nFrom forking the repository to creating pull requests, this guide walks you through every stage of the process, helping you make a successful contribution to this GitHub project. Start collaborating,\nlearn new skills, and make an impact on this project!\n\n[See here](https://github.com/simonkovtyk/esbuild-plugin-cleanup/blob/main/docs/guides/HOW_TO_CONTRIBUTE.md) for the contribute guide at GitHub.\n\n\u003chr\u003e\n\nGitHub [@simonkovtyk](https://github.com/simonkovtyk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-cleanup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-cleanup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-cleanup/lists"}