{"id":13678207,"url":"https://github.com/sumy7/rsbuild-plugin-generate-file","last_synced_at":"2025-04-29T12:34:07.371Z","repository":{"id":221340316,"uuid":"754091533","full_name":"sumy7/rsbuild-plugin-generate-file","owner":"sumy7","description":"About Generate extra file to dist folder.","archived":false,"fork":false,"pushed_at":"2024-09-14T07:53:54.000Z","size":165,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-14T09:26:48.733Z","etag":null,"topics":["rsbuild","rsbuild-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/sumy7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":["sumy7"]}},"created_at":"2024-02-07T11:38:42.000Z","updated_at":"2024-09-14T07:53:56.000Z","dependencies_parsed_at":"2024-02-07T13:29:10.107Z","dependency_job_id":"92b43047-d48e-4f56-90b2-2152112905bc","html_url":"https://github.com/sumy7/rsbuild-plugin-generate-file","commit_stats":null,"previous_names":["sumy7/rsbuild-plugin-generate-file"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumy7%2Frsbuild-plugin-generate-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumy7%2Frsbuild-plugin-generate-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumy7%2Frsbuild-plugin-generate-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumy7%2Frsbuild-plugin-generate-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumy7","download_url":"https://codeload.github.com/sumy7/rsbuild-plugin-generate-file/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173641,"owners_count":17268145,"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":["rsbuild","rsbuild-plugin"],"created_at":"2024-08-02T13:00:51.096Z","updated_at":"2024-11-11T20:31:11.746Z","avatar_url":"https://github.com/sumy7.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sumy7"],"categories":["Plugins"],"sub_categories":["Rsbuild Plugins"],"readme":"# rsbuild-plugin-generate-file\n\n[![npm](https://img.shields.io/npm/dt/rsbuild-plugin-generate-file.svg)](https://www.npmjs.com/package/rsbuild-plugin-generate-file)  [![npm](https://img.shields.io/npm/v/rsbuild-plugin-generate-file.svg)](https://www.npmjs.com/package/rsbuild-plugin-generate-file) [![npm](https://img.shields.io/npm/l/rsbuild-plugin-generate-file.svg)](https://www.npmjs.com/package/rsbuild-plugin-generate-file)\n\n**rsbuild-plugin-generate-file** is a rsbuild plugin which generate static file and write them to dist folder after packaging.\n\n## Usage\n\nInstall dev dependency :\n\n```shell\nyarn add rsbuild-plugin-generate-file -D\nnpm install rsbuild-plugin-generate-file -D\n```\n\nAdd plugin to your `rsbuild.config.ts` :\n\n```typescript\n// rsbuild.config.ts\nimport { pluginGenerateFile } from 'rsbuild-plugin-generate-file';\n\nexport default {\n  plugins: [\n    pluginGenerateFile([{\n      type: 'json',\n      output: './output.txt',\n      data: {\n        foo: 'bar'\n      }\n    }])\n  ]\n}\n```\n\nHere are the available options for configuration:\n\n| Name          | Description                                                                                                                          | Options                   | Defaults       |\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------|----------------|\n| `type`        | Specifies the format type of the generated file.                                                                                     | `json`  `yaml` `template` | `json`         |\n| `output`      | Defines the path to the output file that the plugin will generate. This path is relative to the `dist` folder.                       | -                         | `./output.txt` |\n| `template`    | Specifies the path to the template file. Supports `ejs` format template. This option is available when `type` is set to `template`.  | -                         | -              |\n| `data`        | Specifies the data to be used in the generated file or to be passed into the template.                                               | -                         | -              |\n| `contentType` | Defines the Content-Type response returned from the dev server. If left empty, it will be inferred from the `output` path extension. | -                         | -              |\n\nIn dev mode, plugin will mock file by dev server.\nSee [localhost:8080/__generate_file_list/](http://localhost:8080/__generate_file_list/) for more detail.\n\n## Credits\n\nThis plugin was inspired\nby [Alicevia/vite-plugin-generate-config-into-dist](https://github.com/fed/webpack-version-file)\nand [sumy7/vite-plugin-generate-file](https://github.com/sumy7/vite-plugin-generate-file)\nand [antfu/vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumy7%2Frsbuild-plugin-generate-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumy7%2Frsbuild-plugin-generate-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumy7%2Frsbuild-plugin-generate-file/lists"}