Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Remove attributes from vue templates at build time

License

Notifications You must be signed in to change notification settings

marekvospel/unplugin-vue-remove-attribute

Repository files navigation

unplugin-vue-remove-attribute

GitHub version npm version Github license codecov

Powered by unplugin.

Installation

npm i -D unplugin-vue-remove-attribute
Vite
// vite.config.ts
import RemoveAttributes from 'unplugin-vue-remove-attribute/vite'

export default defineConfig({
  plugins: [
    RemoveAttributes({ /* options */ })
  ]
})
Rollup
// rollup.config.js
import RemoveAttributes from 'unplugin-vue-remove-attribute/rollup'

export default {
  plugins: [
    RemoveAttributes({ /* options */ })
  ]
}

Usage

This plugin removes matching attributes in vue components, so testing attributes like data-test-... are removed in production build.

Thanks

Thanks to @antfu, this project is heavily inspired by unplugin-vue-components.

License

MIT License © 2022-PRESENT Marek Vospěl