/unplugin-vue-remove-attribute

Remove attributes from vue templates at build time

Primary LanguageTypeScriptMIT LicenseMIT

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