This is a SWC-based plugin that removes some attributes from jsx, such as data-testid.
Under normal circumstances, it will only take effect when compiling, and will not take effect on the vite server.
npm install --save-dev @julong/vite-plugin-jsx-remove-attrs
import removeAttrs from '@julong/vite-plugin-jsx-remove-attrs';
export default defineConfig(() => {
plugins: [
removeAttrs(['data-testid', 'data-xxx']),
],
});
JuLong - jl917
Anyone is welcome to participate in the maintenance and development of this project, and can also submit Issues and PR's