diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index 0d61302ff..e96d681d6 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -272,6 +272,26 @@ export default { }, }, }) + const tagAttributesForTesting = ['data-test', ':data-test', 'v-bind:data-test'] + ctx.loaders.vue.compilerOptions = { + modules: [ + { + preTransformNode(astEl) { + if (!ctx.isDev) { + const { attrsMap, attrsList } = astEl + tagAttributesForTesting.forEach(attribute => { + if (attrsMap[attribute]) { + delete attrsMap[attribute] + const index = attrsList.findIndex(attr => attr.name === attribute) + attrsList.splice(index, 1) + } + }) + } + return astEl + }, + }, + ], + } }, }, }