Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cogor/vite-plugin-vue-remove-attributes

Remove data attributes from SFC at build time
https://github.com/cogor/vite-plugin-vue-remove-attributes

vitejs vue

Last synced: 3 days ago
JSON representation

Remove data attributes from SFC at build time

Awesome Lists containing this project

README

        

# vite-plugin-vue-remove-attributes
Remove data attributes from SFC at build time

## 📦 Install

```bash
npm i vite-plugin-vue-remove-attributes -D

# yarn
yarn add vite-plugin-vue-remove-attributes -D

# pnpm
pnpm add vite-plugin-vue-remove-attributes -D
```

## 🦄 Usage

Add plugin to your vite.config.js

```javascript
import { defineConfig } from "vite";
import removeAttrsPlugin from "vite-plugin-vue-remove-attributes";

export default defineConfig({
plugins: [
removeAttrsPlugin(["test-id"]) // By default ["test-id"]
]
});
```

Inspired by [vue-cli-plugin-test-attrs](https://github.com/LinusBorg/vue-cli-plugin-test-attrs)