{"id":14977074,"url":"https://github.com/mustafadalga/remove-attr","last_synced_at":"2025-10-27T23:31:36.010Z","repository":{"id":167496336,"uuid":"642952101","full_name":"mustafadalga/remove-attr","owner":"mustafadalga","description":"Vite Plugin - Remove Attributes","archived":false,"fork":false,"pushed_at":"2024-08-22T07:38:24.000Z","size":44,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T09:11:13.473Z","etag":null,"topics":["build-tool","optimization","remove-attr","remove-attribute","remove-attributes","vite","vite-plugin","vite-plugin-remove-attr","vitejs","vue","vue3","vuejs","web-development"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/remove-attr","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/mustafadalga.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":"2023-05-19T18:17:49.000Z","updated_at":"2024-10-28T11:19:03.000Z","dependencies_parsed_at":"2024-03-31T13:25:31.229Z","dependency_job_id":"91d3ef5e-0c0c-4017-a198-59f02b702070","html_url":"https://github.com/mustafadalga/remove-attr","commit_stats":null,"previous_names":["mustafadalga/remove-attr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafadalga%2Fremove-attr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafadalga%2Fremove-attr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafadalga%2Fremove-attr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafadalga%2Fremove-attr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mustafadalga","download_url":"https://codeload.github.com/mustafadalga/remove-attr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238574405,"owners_count":19494721,"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":["build-tool","optimization","remove-attr","remove-attribute","remove-attributes","vite","vite-plugin","vite-plugin-remove-attr","vitejs","vue","vue3","vuejs","web-development"],"created_at":"2024-09-24T13:55:00.747Z","updated_at":"2025-10-27T23:31:35.705Z","avatar_url":"https://github.com/mustafadalga.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vite Plugin - Remove Attributes\n\nThis Vite plugin is specifically designed for Vue.js projects. It allows the removal of specified attributes in\nproduction builds, supporting a variety of options like file extensions, attributes, ignored folders, and files.\n\n\u003cp align=\"center\"\u003e\n\n[![vue version](https://img.shields.io/npm/v/remove-attr.svg)](https://www.npmjs.com/package/remove-attr)\n[![vue version](https://img.shields.io/badge/vite-4.3.2-brightgreen.svg)](https://www.npmjs.com/package/remove-attr)\n\n\u003c/p\u003e\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Prerequisites](#prerequisites)\n    - [Examples](#examples)\n- [License](#license)\n\n## Features\n\n1. Removes specified attributes in production builds of Vue.js projects.\n2. Allows you to specify the file extensions to be considered.\n3. Can ignore certain folders or files based on configuration.\n4. Ensures clean production code by removing unnecessary attributes, like 'data-testid' used in testing.\n\n## Installation\n\nYou can install this plugin through npm:\n\n```sh\nnpm install --save-dev remove-attr\n```\n\n## Usage\n\n### Prerequisites\n\nTo use this plugin, you need to have a Vite project set up. Import and use the plugin in your vite.config.js or\nvite.config.ts file.\n\n```typescript\nimport { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport removeAttr from 'remove-attr'\n\nexport default defineConfig({\n    plugins: [\n        vue(),\n        removeAttr({\n            extensions: [ 'vue' ],\n            attributes: [ 'data-testid' ]\n        })\n    ]\n})\n\n```\n\u003cbr /\u003e \n\n## Examples\n\n#### Example 1: Removing 'data-testid' attributes from '.vue' files\n\nThis configuration will remove 'data-testid' attributes from all '.vue' files in the production build.\n\n```typescript\nexport default defineConfig({\n    plugins: [\n        vue(),\n        removeAttr({\n            extensions: [ 'vue' ],\n            attributes: [ 'data-testid' ]\n        })\n    ]\n})\n```\n\u003cbr /\u003e \n\n#### Example 2: Ignoring specific folders and files\n\nThis configuration will remove 'data-testid' and 'data-id' attributes from all '.vue', '.ts', and '.js' files, with the exception of those in the 'src/tests' and 'src/utilities' folders, as well as the 'Home.vue', 'src/components/Modal.vue', and 'src/layouts/LayoutAuth.vue' files.\n```typescript\nexport default defineConfig({\n    plugins: [\n        vue(),\n        removeAttr({\n            extensions: [ 'vue', \"ts\", \"ts\" ],\n            attributes: [ 'data-testid', \"data-id\" ],\n            ignoreFolders: [ 'src/tests', \"src/utilities\" ],\n            ignoreFiles: [ 'Home.vue', 'src/components/Modal.vue', \"src/layouts/LayoutAuth.vue\" ]\n        })\n    ]\n})\n```\n\n\u003cbr /\u003e \n\n## License\n[![License](https://img.shields.io/badge/LICENSE-GPL--3.0-orange)](https://github.com/mustafadalga/remove-attr/blob/main/LICENSE)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafadalga%2Fremove-attr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmustafadalga%2Fremove-attr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafadalga%2Fremove-attr/lists"}