ui_migration configure(vitest) add npm run commands, fix codespell for test .spec.files, remove comments, remove data tags on vite build, and refine packages
This commit is contained in:
parent
fb15178512
commit
b517721ff9
5 changed files with 106 additions and 511 deletions
|
|
@ -10,6 +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';
|
||||
|
||||
var target;
|
||||
|
||||
|
|
@ -27,7 +28,22 @@ export default defineConfig(({ command, mode }) => {
|
|||
}
|
||||
|
||||
return {
|
||||
plugins: [vue()],
|
||||
plugins: [
|
||||
vue({
|
||||
// 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');
|
||||
}
|
||||
}
|
||||
] : []
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
|
||||
build: {
|
||||
// Output directory for production builds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue