{"id":22694774,"url":"https://github.com/kiosion/vite-plugin-test-selectors","last_synced_at":"2026-04-10T11:32:47.208Z","repository":{"id":50297129,"uuid":"518622708","full_name":"kiosion/vite-plugin-test-selectors","owner":"kiosion","description":"Simple vite plugin for stripping test selectors in production builds","archived":false,"fork":false,"pushed_at":"2023-07-19T19:57:46.000Z","size":332,"stargazers_count":2,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-11T15:32:53.044Z","etag":null,"topics":["react","svelte","test-selectors","testing","vite","vite-plugin","vue"],"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/kiosion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["kiosion"],"ko_fi":"kiosion"}},"created_at":"2022-07-27T21:58:40.000Z","updated_at":"2023-08-21T19:20:32.000Z","dependencies_parsed_at":"2025-01-06T07:46:17.524Z","dependency_job_id":null,"html_url":"https://github.com/kiosion/vite-plugin-test-selectors","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.052631578947368474","last_synced_commit":"8f19b702000d8c06528902cc18f4b7dc26208d59"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kiosion/vite-plugin-test-selectors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-test-selectors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-test-selectors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-test-selectors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-test-selectors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiosion","download_url":"https://codeload.github.com/kiosion/vite-plugin-test-selectors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-test-selectors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31641114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: 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":["react","svelte","test-selectors","testing","vite","vite-plugin","vue"],"created_at":"2024-12-10T03:09:50.756Z","updated_at":"2026-04-10T11:32:47.186Z","avatar_url":"https://github.com/kiosion.png","language":"TypeScript","funding_links":["https://github.com/sponsors/kiosion","https://ko-fi.com/kiosion"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n  \u003ch1\u003evite-plugin-test-selectors\u003c/h1\u003e\n  \u003cp\u003eSimple vite plugin for stripping test selectors in production builds\u003c/p\u003e\n\n  \u003cimg src='https://user-images.githubusercontent.com/34040324/181411503-a9d6ed3e-75ba-4258-85be-7070a276d496.png' width='750' alt='Demo' /\u003e\n\u003c/div\u003e\n\n## Supported frameworks\n\n- React\n- Vue\n- Svelte\n\n## Installation\n\n\u003e **Warning:** This plugin is still in development!\n\nInstall using yarn or npm:\n```bash\nyarn add vite-plugin-test-selectors -D\n```\n\n## Usage\n\nAdd to your vite config:\n```js\nimport { defineConfig } from 'vite';\nimport StripTestSelectors from 'vite-plugin-test-selectors';\n\nexport default defineConfig({\n  plugins: [\n    StripTestSelectors()\n  ]\n});\n```\n\nThen, customize any of the following options:\n\n```js\nStripTestSelectors({\n  dev: false,\n  selectors: ['data-test'],\n  suffixes: ['.jsx', '.tsx', '.vue', '.svelte'],\n})\n```\n\n'Dev' is a boolean that determines whether to apply the plugin on serve or build. It defaults to 'false', only stripping test attributes in production builds.\n\nThe provided selectors are optional (defaulting to only 'data-test'), and are parsed as `selector-*`, where `*` is any string optionally followed by a value assignment. For example:\n\n```html\n\u003c!-- Will not be stripped --\u003e\n\u003cComponent class=\"someClass\" data-test /\u003e\n\u003c!-- Will be stripped --\u003e\n\u003cComponent class=\"someClass\" data-test-component data-test-id=\"someId\" /\u003e\n```\n\nSuffixes are also optional, and are an array of any valid file extensions. They default to '.jsx', '.tsx', '.vue', and '.svelte'.\n\nFor example usage, check out the [included demos](demos/).\n\n## Testing\n\n```bash\nyarn test\n```\n\n## Credits\n\nAuthors: [kiosion](https://github.com/kiosion/vite-plugin-test-selectors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiosion%2Fvite-plugin-test-selectors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiosion%2Fvite-plugin-test-selectors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiosion%2Fvite-plugin-test-selectors/lists"}