{"id":22619825,"url":"https://github.com/simonkovtyk/esbuild-plugin-file-copy","last_synced_at":"2026-01-20T23:08:36.000Z","repository":{"id":256260412,"uuid":"854166869","full_name":"simonkovtyk/esbuild-plugin-file-copy","owner":"simonkovtyk","description":"The plugin copies files to the esbuild out folder, ensuring that all required files are included alongside the built code.","archived":false,"fork":false,"pushed_at":"2024-09-28T15:05:20.000Z","size":36,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T11:22:10.621Z","etag":null,"topics":["assets-management","copy-assets","copy-files","esbuild","esbuild-copy","esbuild-plugin","esbuild-plugins","static-file","static-file-copy","static-files","static-files-copy"],"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}},"created_at":"2024-09-08T14:55:37.000Z","updated_at":"2024-12-28T15:31:28.000Z","dependencies_parsed_at":"2024-09-15T04:01:57.748Z","dependency_job_id":null,"html_url":"https://github.com/simonkovtyk/esbuild-plugin-file-copy","commit_stats":null,"previous_names":["simonkovtyk/esbuild-plugin-file-copy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-file-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-file-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-file-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-file-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonkovtyk","download_url":"https://codeload.github.com/simonkovtyk/esbuild-plugin-file-copy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429129,"owners_count":21101786,"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":["assets-management","copy-assets","copy-files","esbuild","esbuild-copy","esbuild-plugin","esbuild-plugins","static-file","static-file-copy","static-files","static-files-copy"],"created_at":"2024-12-08T22:09:14.377Z","updated_at":"2026-01-20T23:08:35.938Z","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-file-copy/c2d47dd6381cd8b71255ae4cfbd0fce6dec49eeb/docs/esbuild-favicon.svg\" /\u003e\n\n\u003ch1\u003eFile Copy Plugin\u003c/h1\u003e\n\n\u003cp\u003eThis esbuild plugin copies specified files to the output folder after the bundling process. It ensures static assets are included in the final build without interrupting or altering the main esbuild workflow.\u003c/p\u003e\n\n![NPM Downloads](https://img.shields.io/npm/dw/esbuild-plugin-file-copy)\n![NPM License](https://img.shields.io/npm/l/esbuild-plugin-file-copy)\n![GitHub package.json version](https://img.shields.io/npm/v/esbuild-plugin-file-copy)\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-file-copy\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-file-copy\n\u003e ````\n\n\u003e 💾 **pnpm**\n\u003e ````shell\n\u003e pnpm install -D esbuild-plugin-file-copy\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 simply copies specified files to the output folder during the build process. It reads a list of file paths or patterns, then moves those files into the output directory after\nesbuild finishes bundling.\n\nThe plugin ensures that static assets, such as images or configuration files, are included in the final build. It’s lightweight and works without altering the bundling\nprocess itself. By automating file copying, it reduces manual steps and keeps the build process smooth and consistent.\n\n## 🔧 Usage\n\n```typescript\nfileCopyPlugin(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 esbuild configuration...\n  plugins: [\n    fileCopyPlugin(\n      // configure it here...\n    );\n    // more esbuild plugins here...\n  ]\n})\n````\n\n\u003c/details\u003e\n\n### Properties\n\n#### ``lifecycle``\n\n\u003e Default: ``onEnd``\n\nAn string with either the value ``onStart`` or ``onEnd``.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example\u003c/summary\u003e\n\n````typescript\nfileCopyPlugin({\n  lifecycle: \"onStart\"\n});\n````\n\n\u003c/details\u003e\n\n[See here](https://esbuild.github.io/plugins/#concepts) for more about esbuild lifecycles.\n\n#### ``inputs``\n\n\u003e Default: ``undefined``\n\nA ``Array`` of ``object`` with the following properties:\n\n````typescript\n{\n  from: string,\n  to: string\n}\n````\n\nAny file or directory from the source path (``from`` key) will be copied to the target path (``to`` key).\n\nThe file name will be kept while copying the file from source path to target path.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example\u003c/summary\u003e\n\n````typescript\nfileCopyPlugin({\n  inputs: [{\n    from: \"my-lib/example.ts\", // input path\n    to: \"dist/my-lib\" // copied to path\n  }]\n});\n````\n\n\u003c/details\u003e\n\n#### ``globs``\n\n\u003e Default: ``undefined``\n\nA ``Array`` of ``object`` with the following properties:\n\n````typescript\n{\n  from: string,\n  to: string\n}\n````\n\nAny matching file or directory from the source path (``from`` key) will be copied to the target path (``to`` key).\n\nThe file name will be kept while copying the file from source path to target path.\n\nThis option enables the use of glob patterns. [See here](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/) for more about glob patterns.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example\u003c/summary\u003e\n\n````typescript\nfileCopyPlugin({\n  globs: [{\n    from: \"my-lib/**/*.env\", // input path\n    to: \"dist/my-lib\" // copied to path\n  }]\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-file-copy/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-file-copy/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-file-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-file-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-file-copy/lists"}