{"id":26618,"library":"vue-remove-attributes","title":"vue-remove-attributes","description":"vue-remove-attributes 1.0.3 is a Vue template compiler module that removes unwanted attributes (e.g., data-testid) from Vue single-file component templates at build time. It integrates with vue-loader via compilerOptions and supports matching attributes by string, array, or regex. Heavily dependent on vue-template-compiler (or @vue/compiler-sfc for Vue 3), it is best suited for Vue 2 projects using Webpack, similar to babel-plugin-jsx-remove-data-test-id but for Vue templates. Currently stable with low release cadence and limited community adoption.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/emensch/vue-remove-attributes","tags":["javascript","vue","template","compiler","webpack","module","HTML","attribute","remove","typescript"],"install":[{"cmd":"npm install vue-remove-attributes","lang":"bash","label":"npm"},{"cmd":"yarn add vue-remove-attributes","lang":"bash","label":"yarn"},{"cmd":"pnpm add vue-remove-attributes","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for the compiler module; must match the Vue version used.","package":"vue-template-compiler","optional":false}],"imports":[{"note":"The package exports a single default function; named import will be undefined.","wrong":"import { createAttributeRemover } from 'vue-remove-attributes'","symbol":"default (createAttributeRemover)","correct":"import createAttributeRemover from 'vue-remove-attributes'"},{"note":"CommonJS require returns the default export directly, not an object.","wrong":"const { createAttributeRemover } = require('vue-remove-attributes')","symbol":"default (CommonJS)","correct":"const createAttributeRemover = require('vue-remove-attributes')"},{"note":"The package does not export a named type; use import type for the default export.","wrong":"import { CreateAttributeRemover } from 'vue-remove-attributes'","symbol":"TypeScript type","correct":"import type CreateAttributeRemover from 'vue-remove-attributes'"}],"quickstart":{"code":"// webpack.config.js\nconst createAttributeRemover = require('vue-remove-attributes');\n\nmodule.exports = {\n  entry: './src/main.js',\n  module: {\n    rules: [\n      {\n        test: /\\.vue$/,\n        use: {\n          loader: 'vue-loader',\n          options: {\n            compilerOptions: {\n              modules: [\n                createAttributeRemover('data-testid')\n              ]\n            }\n          }\n        }\n      }\n    ]\n  }\n};","lang":"javascript","description":"Shows how to require the module and configure vue-loader to remove 'data-testid' attributes from all components."},"warnings":[{"fix":"Use an array or regex that matches all permutations: createAttributeRemover(['data-testid', ':data-testid', 'v-bind:data-testid']) or a regex like /^:?v-bind:?data-testid$/.","message":"Attributes like :data-testid and v-bind:data-testid are treated as separate from data-testid; they will not be removed unless explicitly matched.","severity":"gotcha","affected_versions":"<=1.0.3"},{"fix":"For Vue 3, use @vue/compiler-sfc's compileTemplate option or migrate to a different solution like babel-plugin-jsx-remove-data-test-id for JSX templates.","message":"The package depends on vue-template-compiler which is deprecated for Vue 3 in favor of @vue/compiler-sfc.","severity":"deprecated","affected_versions":"<=1.0.3"},{"fix":"Use Node.js 10 or higher.","message":"Version 1.0.0 dropped support for Node.js < 10.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.3':9 '2':69 '3':62 'adopt':96 'array':48 'attribut':4,8,19,45,104 'babel':76 'babel-plugin-jsx-remove-data-test-id':75 'best':65 'build':32 'cadenc':92 'communiti':95 'compil':14,57,100 'compileropt':41 'compon':29 'current':87 'data':22,80 'data-testid':21 'depend':52 'e.g':20 'file':28 'heavili':51 'html':103 'id':82 'integr':35 'javascript':97 'jsx':78 'limit':94 'loader':39 'low':90 'match':44 'modul':15,102 'plugin':77 'project':70 'regex':50 'releas':91 'remov':3,7,17,79,105 'similar':73 'singl':27 'single-fil':26 'stabl':88 'string':47 'suit':66 'support':43 'templat':13,30,56,86,99 'test':81 'testid':23 'time':33 'typescript':106 'unwant':18 'use':71 'via':40 'vue':2,6,12,25,38,55,61,68,85,98 'vue-load':37 'vue-remove-attribut':1,5 'vue-template-compil':54 'vue/compiler-sfc':59 'webpack':72,101","created_at":"2026-05-01T13:50:54.921227+00:00","updated_at":"2026-05-01T13:50:54.921227+00:00","problems":[{"fix":"Use default import: import createAttributeRemover from 'vue-remove-attributes' or const createAttributeRemover = require('vue-remove-attributes').","cause":"Named import instead of default import.","error":"TypeError: createAttributeRemover is not a function"},{"fix":"Ensure you are passing options to vue-loader: { loader: 'vue-loader', options: { compilerOptions: { modules: [...] } } }.","cause":"Misconfiguration of vue-loader options.","error":"Cannot read property 'compilerOptions' of undefined"},{"fix":"Install vue-template-compiler as a dev dependency: npm install -D vue-template-compiler.","cause":"Missing peer dependency.","error":"Module not found: Can't resolve 'vue-template-compiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/emensch/vue-remove-attributes","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vue-remove-attributes","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}