I want to import the npm package vue-remove-attributes to remove my "data-testid" attributes from the DOM. https://www.npmjs.com/package/vue-remove-attributes
In the README they say i've to pass the module to vue-loader in my webpack config. I have webpack installed but my only config file is vue.config.js which looks like this:
module.exports = {
publicPath: "./",
productionSourceMap: false,
lintOnSave: process.env.NODE_ENV !== "production",
}
I tried importing the module like this
const createAttributeRemover = require('vue-remove-attributes');
module.exports = {
publicPath: "./",
productionSourceMap: false,
lintOnSave: process.env.NODE_ENV !== "production",
configureWebpack: {
plugins: new createAttributeRemover(),
module: {
rules: [
{
test: /\.vue$/,
use: {
loader: "vue-loader",
options: {
compilerOptions: {
modules: [createAttributeRemover("data-testid")]
}
}
}
}
]
}
},
};
but that doesn't seem to work. Any ideas how I can import the npm package in my vue config?