{"id":25443911,"url":"https://github.com/csath/gatsby-plugin-copy-files-enhanced","last_synced_at":"2025-11-01T18:30:23.585Z","repository":{"id":46632671,"uuid":"267844249","full_name":"csath/gatsby-plugin-copy-files-enhanced","owner":"csath","description":"You can use this plugin to copy files in your Gatsby project. Specify absolute source path and relative destination path using plugin options.","archived":false,"fork":false,"pushed_at":"2021-10-14T08:51:39.000Z","size":87,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T05:56:41.657Z","etag":null,"topics":["file-copy","gatsby","gatsby-plugin","gatsby-plugin-copy-files","gatsby-plugin-copy-files-enhanced"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-29T11:46:27.000Z","updated_at":"2022-12-17T05:18:46.000Z","dependencies_parsed_at":"2022-08-29T15:01:56.150Z","dependency_job_id":null,"html_url":"https://github.com/csath/gatsby-plugin-copy-files-enhanced","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fgatsby-plugin-copy-files-enhanced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fgatsby-plugin-copy-files-enhanced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fgatsby-plugin-copy-files-enhanced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csath%2Fgatsby-plugin-copy-files-enhanced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csath","download_url":"https://codeload.github.com/csath/gatsby-plugin-copy-files-enhanced/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239120130,"owners_count":19584978,"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":["file-copy","gatsby","gatsby-plugin","gatsby-plugin-copy-files","gatsby-plugin-copy-files-enhanced"],"created_at":"2025-02-17T15:17:43.893Z","updated_at":"2025-11-01T18:30:23.538Z","avatar_url":"https://github.com/csath.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gatsby-plugin-copy-files-enhanced  [![npm](https://img.shields.io/npm/v/gatsby-plugin-copy-files-enhanced.svg)](https://npmjs.com/package/gatsby-plugin-copy-files-enhanced)  [![npm](https://img.shields.io/npm/dm/gatsby-plugin-copy-files-enhanced.svg)](https://npmjs.com/package/gatsby-plugin-copy-files-enhanced)\n\nYou can use this plugin to copy files in your Gatsby project. Specify absolute `source` path and relative `destination` path using plugin options.\n\n#### What's different from `gatsby-plugin-copy-files`\n\n- In `gatsby-plugin-copy-files` you should specify destination and you have no option to copy to multiple direcotries **in one go**. `gatsby-plugin-copy-files-enhanced` enables you to wildcard your destination, so that you can easily copy files.\n\n- This plugin has option to **overwrite** your destination direcotry simply using `purge` plugin option.\n\n\n#### Plugin options\n\n| Option    | Description |\n|:----------|:---------|\n|`source`     |Absolute path of the source (eg: `${__dirname}/path`)|\n|`destination`|Relative path to destination within `public/` direcotry \u003c/br\u003e You can add `/*/` inside destination path to wildcard destination lookup \u003c/br\u003e *Refer to [graphical explanation](#graphical-explanation) for better understanding*\n|`purge`      |Overwrite destination. `false` by default|\n\n#### Important\nThis plugin should be used with `gatsby-source-filesystem`\n\n#### Eample\n``` js\n{\n    resolve: 'gatsby-plugin-copy-files-enhanced',\n    options: {\n        source: `${__dirname}/src/reportTemplate` ,\n        destination: '/reports/*/',\n        purge: true,\n    }\n}, {\n    resolve: 'gatsby-plugin-copy-files-enhanced',\n    options: {\n        source: `${__dirname}/src/images` ,\n        destination: '/containers/*/images',\n        purge: false,\n    }\n}\n```\n\n#### Graphical explanation\n\nLet's consider that you have a `template.js` file that you need to copy to all reports within `public/reports/` direcotry and you are not sure of report names and how many would be there.\n\n\n\u003cimg src=\"https://github.com/csath/gatsby-plugin-copy-files-enhanced/blob/master/assets/start.png\" width=\"350\"\u003e\n\n\nIn such case you can wildcard the destination path so that you can easily copy `template.js` to all direcotries with `public/reports/`\n\n\u003cimg src=\"https://github.com/csath/gatsby-plugin-copy-files-enhanced/blob/master/assets/end.png\" width=\"350\"\u003e\n\n\n##### Simply use this code to get this done\n``` js\n{\n    resolve: 'gatsby-plugin-copy-files-enhanced',\n    options: {\n        source: `${__dirname}/src/template/` ,\n        destination: '/reports/*/',\n        purge: true,\n    }\n}\n```\n\n\u003ci\u003eInspired by `gatsby-plugin-copy-files` \u003c/i\u003e \u003c3\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsath%2Fgatsby-plugin-copy-files-enhanced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsath%2Fgatsby-plugin-copy-files-enhanced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsath%2Fgatsby-plugin-copy-files-enhanced/lists"}