- frontend/Dockerfile: Node 20 Alpine image running npm run dev - docker-compose: frontend service with depends_on db/minio/backend, source mounted as volume, named volume for node_modules to avoid OS binary conflicts between host and container - vite.config.ts: make API proxy target configurable via API_PROXY_TARGET env var (defaults to localhost:8080 for local dev, set to http://backend:8080 inside Docker) - .env: update PORT_FRONTEND to 5173 (actual vite dev server port) Usage: docker compose up frontend # starts frontend + all dependencies docker compose up # starts everything Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
import { paraglideVitePlugin } from '@inlang/paraglide-js';
|
|
import devtoolsJson from 'vite-plugin-devtools-json';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import { defineConfig } from 'vitest/config';
|
|
import { playwright } from '@vitest/browser-playwright';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
host: '0.0.0.0', // Erlaubt Zugriff von außen
|
|
port: 5173, // Standard SvelteKit Port
|
|
// Proxy für API-Aufrufe während der Entwicklung (Browser -> Vite -> Spring Boot)
|
|
proxy: {
|
|
'/api': {
|
|
target: process.env.API_PROXY_TARGET || 'http://localhost:8080',
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
},
|
|
plugins: [
|
|
tailwindcss(),
|
|
sveltekit(),
|
|
devtoolsJson(),
|
|
paraglideVitePlugin({
|
|
project: './project.inlang',
|
|
outdir: './src/lib/paraglide'
|
|
})
|
|
],
|
|
test: {
|
|
expect: { requireAssertions: true },
|
|
projects: [
|
|
{
|
|
extends: './vite.config.ts',
|
|
test: {
|
|
name: 'client',
|
|
browser: {
|
|
enabled: true,
|
|
provider: playwright(),
|
|
instances: [{ browser: 'chromium', headless: true }],
|
|
screenshotDirectory: 'test-results/screenshots',
|
|
screenshotFailures: true
|
|
},
|
|
include: ['src/**/*.svelte.{test,spec}.{js,ts}'],
|
|
exclude: ['src/lib/server/**']
|
|
}
|
|
},
|
|
{
|
|
extends: './vite.config.ts',
|
|
test: {
|
|
name: 'server',
|
|
environment: 'node',
|
|
include: ['src/**/*.{test,spec}.{js,ts}'],
|
|
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}']
|
|
}
|
|
}
|
|
]
|
|
}
|
|
});
|