diff --git a/vite.config.ts b/vite.config.ts index 725b07f..3e0e227 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,6 +16,17 @@ if (process.env.NODE_ENV?.toLowerCase() === 'test') { nycrcPath: './.nycrc.json', }) ); +} else { + plugins.push({ + name: 'remove-testids', + enforce: 'pre', + transform(code, id) { + if (id.endsWith('.svelte')) { + return code.replace(/data-testid=".*?"/g, ''); + } + return code; + }, + }); } const config: UserConfig = {