{"id":25850583,"url":"https://github.com/azat-io/vite-plugin-prettier-format","last_synced_at":"2025-07-14T01:13:26.345Z","repository":{"id":280121432,"uuid":"941056383","full_name":"azat-io/vite-plugin-prettier-format","owner":"azat-io","description":"⚡ Vite plugin for formatting output code using Prettier","archived":false,"fork":false,"pushed_at":"2025-03-01T11:42:56.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T11:45:29.702Z","etag":null,"topics":["prettier","vite","vite-plugin"],"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/azat-io.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.config.json","contributing":null,"funding":null,"license":"license.md","code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-01T11:31:08.000Z","updated_at":"2025-03-01T11:45:04.000Z","dependencies_parsed_at":"2025-03-01T11:46:20.290Z","dependency_job_id":"9cf27143-4e8d-474e-920a-2d1f4903d135","html_url":"https://github.com/azat-io/vite-plugin-prettier-format","commit_stats":null,"previous_names":["azat-io/vite-plugin-prettier-format"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fvite-plugin-prettier-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fvite-plugin-prettier-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fvite-plugin-prettier-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azat-io%2Fvite-plugin-prettier-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azat-io","download_url":"https://codeload.github.com/azat-io/vite-plugin-prettier-format/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241363536,"owners_count":19950786,"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":["prettier","vite","vite-plugin"],"created_at":"2025-03-01T12:24:35.904Z","updated_at":"2025-03-01T12:24:36.347Z","avatar_url":"https://github.com/azat-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vite Plugin Prettier Format\n\n\u003cimg\n  src=\"https://raw.githubusercontent.com/azat-io/vite-plugin-prettier-format/main/assets/logo.svg\"\n  alt=\"ESLint Plugin De Morgan logo\"\n  align=\"right\"\n  height=\"160\"\n  width=\"160\"\n/\u003e\n\n[![Version](https://img.shields.io/npm/v/vite-plugin-prettier-format.svg?color=ffc820\u0026labelColor=906dfe)](https://npmjs.com/package/vite-plugin-prettier-format)\n[![Code Coverage](https://img.shields.io/codecov/c/github/azat-io/vite-plugin-prettier-format.svg?color=ffc820\u0026labelColor=906dfe)](https://npmjs.com/package/vite-plugin-prettier-format)\n[![GitHub License](https://img.shields.io/badge/license-MIT-232428.svg?color=ffc820\u0026labelColor=906dfe)](https://github.com/azat-io/vite-plugin-prettier-format/blob/main/license.md)\n\nA Vite plugin that formats output files with Prettier after bundle generation.\n\nThis plugin is particularly useful when you're building a library with Vite in library mode.\n\nWith this plugin, you can ensure that all your library's distribution files maintain consistent and clean formatting according to your Prettier standards.\n\n## How It Works\n\nThis plugin hooks into Vite's build process and executes at the closeBundle phase (after bundle generation). It will:\n\n1. Find all files in the output directory (specified by build.outDir in your Vite config).\n2. Read each file's content.\n3. Format the content using Prettier with your existing configuration.\n4. Write the formatted content back to the file.\n\n## Installation\n\nYou'll first need to install [Vite](https://vitejs.dev) and [Prettier](https://prettier.io):\n\n```bash\nnpm install --save-dev vite prettier\n```\n\nThen install `vite-plugin-prettier-format`:\n\n```bash\nnpm install --save-dev vite-plugin-prettier-format\n```\n\n## Usage\n\nAdd `vite-plugin-prettier-format` to your Vite config file:\n\n```javascript\n// vite.config.js\nimport { defineConfig } from 'vite'\nimport prettierFormat from 'vite-plugin-prettier-format'\n\nexport default defineConfig({\n  plugins: [prettierFormat()],\n})\n```\n\n## Configuration\n\nThe plugin uses your project's Prettier configuration automatically. It attempts to resolve the Prettier config for each file using Prettier's built-in resolveConfig function.\n\nMake sure you have a Prettier configuration file in your project (e.g., `.prettierrc`, `.prettierrc.js`, etc.).\n\n## License\n\nMIT \u0026copy; [Azat S.](https://azat.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazat-io%2Fvite-plugin-prettier-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazat-io%2Fvite-plugin-prettier-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazat-io%2Fvite-plugin-prettier-format/lists"}