ui_migration setup(vitest) Add comments to vitestfile, set and optimise packages on test
This commit is contained in:
parent
b517721ff9
commit
a54980b027
2 changed files with 40 additions and 16 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue