Files
flyer-crawler.projectium.com/vite.config.ts
Torben Sorensen 2f0a114265
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 1m16s
upload file size limit increased in server.ts
2025-11-23 00:36:55 -08:00

58 lines
2.0 KiB
TypeScript

// vite.config.ts
/// <reference types="vitest" />
import path from 'path';
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
/**
* This is the main configuration file for Vite and the Vitest 'unit' test project.
* When running `vitest`, it is orchestrated by `vitest.workspace.ts`, which
* separates the unit and integration test environments.
*/
export default defineConfig({
// Vite-specific configuration for the dev server, build, etc.
// This is inherited by all Vitest projects.
plugins: [react()],
server: {
port: 3000,
host: '0.0.0.0',
},
resolve: {
alias: {
'@': path.resolve(process.cwd(), './src'),
},
},
// Vitest-specific configuration for the 'unit' test project.
test: {
// DEBUGGING LOG: return 'true' to allow the log, 'false' to suppress it.
// We want to SEE debug logs.
onConsoleLog(log) { if (log.includes('[DEBUG]')) return true; },
// The name for this project is defined by the filename in the workspace config.
name: 'unit',
environment: 'jsdom',
globalSetup: './src/tests/setup/global-setup.ts',
setupFiles: ['./src/tests/setup/unit-setup.ts'],
// Explicitly include all test files that are NOT integration tests.
include: ['src/**/*.test.{ts,tsx}'],
// Exclude integration tests and other non-test files from the unit test runner.
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/*.integration.test.ts',
'**/*.e2e.test.ts'
],
coverage: {
provider: 'v8',
// We remove 'text' here. The final text report will be generated by `nyc` after merging.
reporter: ['html', 'json'],
reportsDirectory: './.coverage/unit',
clean: true,
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/main.tsx', 'src/vite-env.d.ts', 'src/types.ts', 'src/vitest.setup.ts',
'src/**/*.test.{ts,tsx}', 'src/components/icons', 'src/services/logger.ts', 'src/services/notificationService.ts'
],
},
},
});