Files
wehub-resource-sync fed8b2eed7
Backend release / release (push) Waiting to run
Bandit Security Scan / bandit_scan (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / manifest (push) Blocked by required conditions
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Waiting to run
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Waiting to run
Build and push DocsGPT FE Docker image for development / manifest (push) Blocked by required conditions
Python linting / ruff (push) Waiting to run
Run python tests with pytest / Run tests and count coverage (3.12) (push) Waiting to run
React Widget Build / build (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:28:29 +08:00

40 lines
1.2 KiB
TypeScript

/// <reference types="vitest" />
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [react(), svgr()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
// Extra dev hosts (e.g. a tailscale name) come from VITE_ALLOWED_HOSTS in
// an untracked .env.local; machine-specific names stay out of the repo.
allowedHosts: env.VITE_ALLOWED_HOSTS
? env.VITE_ALLOWED_HOSTS.split(',')
.map((h) => h.trim())
.filter(Boolean)
: [],
// Use polling for file watching when running inside Docker.
// Native fs events do not propagate from Windows hosts into Linux
// containers, so Chokidar falls back to polling which works reliably.
watch: env.DOCKER
? { usePolling: true, interval: 300 }
: undefined,
},
test: {
environment: 'happy-dom',
globals: true,
include: ['src/**/*.test.{ts,tsx}'],
setupFiles: ['./vitest.setup.ts'],
},
};
});