mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Remove data-test attriubutes in non-dev env
This commit is contained in:
parent
faefe75fe6
commit
58835947ad
@ -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
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user