ui_migration setup(vitest) Add comments to vitestfile, set and optimise packages on test

This commit is contained in:
Antonio Anaya 2026-05-18 20:18:22 -06:00
parent b517721ff9
commit a54980b027
2 changed files with 40 additions and 16 deletions

View file

@ -10,7 +10,7 @@ import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const isProduction = mode === 'production';
const isProduction = mode === "production";
var target;
@ -33,16 +33,18 @@ export default defineConfig(({ command, mode }) => {
// Block for removing data-test-id tags on npm run build
template: {
compilerOptions: {
nodeTransforms: isProduction ? [
(node) => {
if (node.type === 1 /* NodeTypes.ELEMENT */) {
node.props = node.props.filter(prop => prop.name !== 'data-test-id');
}
}
] : []
}
}
})
nodeTransforms: isProduction
? [
(node) => {
if (node.type === 1 /* NodeTypes.ELEMENT */) {
node.props = node.props.filter((prop) => prop.name !== "data-test-id");
}
},
]
: [],
},
},
}),
],
build: {