added various tests for playwright

This commit is contained in:
Codex Agent
2025-12-19 21:56:39 +01:00
parent 778ffc8bb9
commit 18297aa3f1
23 changed files with 818 additions and 109 deletions

View File

@@ -2,9 +2,10 @@ import { wayfinder } from '@laravel/vite-plugin-wayfinder';
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import laravel from 'laravel-vite-plugin';
import { defineConfig } from 'vite';
import { defineConfig, type PluginOption } from 'vite';
import path from 'path';
import { tamaguiPlugin } from '@tamagui/vite-plugin';
import { sentryVitePlugin } from '@sentry/vite-plugin';
const devServerHost = process.env.VITE_DEV_SERVER_HOST ?? 'fotospiel-app.test';
const devServerPort = Number.parseInt(process.env.VITE_DEV_SERVER_PORT ?? '5173', 10);
@@ -12,6 +13,49 @@ const devServerOrigin = process.env.VITE_DEV_SERVER_URL ?? `http://fotospiel-app
const parsedOrigin = new URL(devServerOrigin);
const hmrPort = parsedOrigin.port === '' ? devServerPort : Number.parseInt(parsedOrigin.port, 10);
const appUrl = process.env.APP_URL ?? 'http://fotospiel-app.test';
const sentryEnabled = Boolean(
process.env.SENTRY_AUTH_TOKEN &&
process.env.SENTRY_ORG &&
process.env.SENTRY_PROJECT &&
process.env.SENTRY_URL
);
const plugins: PluginOption[] = [
laravel({
input: ['resources/css/app.css','resources/js/app.js', 'resources/js/app.tsx', 'resources/js/guest/main.tsx', 'resources/js/admin/main.tsx'],
ssr: 'resources/js/ssr.tsx',
refresh: [
'resources/views/**/*.blade.php',
'resources/lang/**/*.php',
'app/Http/Livewire/**', // falls genutzt
// NICHT beobachten: storage/logs, vendor, public/build, etc.
],
}),
react(),
tailwindcss(),
wayfinder({
formVariants: true,
}),
tamaguiPlugin({
config: './tamagui.config.ts',
components: ['@tamagui/core', '@tamagui/stacks', '@tamagui/text', '@tamagui/button'],
optimize: false,
disableExtraction: true,
}),
];
if (sentryEnabled) {
plugins.push(
sentryVitePlugin({
org: process.env.SENTRY_ORG as string,
project: process.env.SENTRY_PROJECT as string,
authToken: process.env.SENTRY_AUTH_TOKEN as string,
url: process.env.SENTRY_URL as string,
release: process.env.SENTRY_RELEASE ?? process.env.VITE_SENTRY_RELEASE,
telemetry: false,
})
);
}
export default defineConfig({
server: {
@@ -64,29 +108,7 @@ export default defineConfig({
},
},
},
plugins: [
laravel({
input: ['resources/css/app.css','resources/js/app.js', 'resources/js/app.tsx', 'resources/js/guest/main.tsx', 'resources/js/admin/main.tsx'],
ssr: 'resources/js/ssr.tsx',
refresh: [
'resources/views/**/*.blade.php',
'resources/lang/**/*.php',
'app/Http/Livewire/**', // falls genutzt
// NICHT beobachten: storage/logs, vendor, public/build, etc.
],
}),
react(),
tailwindcss(),
wayfinder({
formVariants: true,
}),
tamaguiPlugin({
config: './tamagui.config.ts',
components: ['@tamagui/core', '@tamagui/stacks', '@tamagui/text', '@tamagui/button'],
optimize: false,
disableExtraction: true,
}),
],
plugins,
esbuild: {
jsx: 'automatic',
},
@@ -110,7 +132,7 @@ export default defineConfig({
// Build-Optionen wirken vor allem bei `vite build`, schaden aber nicht:
build: {
sourcemap: false,
sourcemap: sentryEnabled,
target: 'es2020',
rollupOptions: {
// keine externen Monster-Globs