Files
wehub-resource-sync cddb07a176
docs / deploy (push) Has been cancelled
docs / changes (push) Has been cancelled
docs / check-and-build (push) Has been cancelled
build container image / cpu (push) Has been cancelled
build container image / cuda (push) Has been cancelled
build container image / rocm (push) Has been cancelled
frontend checks / frontend-checks (push) Has been cancelled
frontend tests / frontend-tests (push) Has been cancelled
lfs checks / lfs-check (push) Has been cancelled
python checks / python-checks (push) Has been cancelled
python tests / py3.12: macos-default (push) Has been cancelled
python tests / py3.11: windows-cpu (push) Has been cancelled
python tests / py3.12: windows-cpu (push) Has been cancelled
python tests / py3.11: linux-cpu (push) Has been cancelled
typegen checks / typegen-checks (push) Has been cancelled
uv lock checks / uv-lock-checks (push) Has been cancelled
openapi checks / openapi-checks (push) Has been cancelled
python tests / py3.11: macos-default (push) Has been cancelled
python tests / py3.12: linux-cpu (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:22:06 +08:00

66 lines
1.7 KiB
TypeScript

/// <reference types="vitest" />
import react from '@vitejs/plugin-react-swc';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
import eslint from 'vite-plugin-eslint';
import { loggerContextPlugin } from './vite-plugin-logger-context';
import babel from 'vite-plugin-babel';
export default defineConfig(({ mode }) => {
return {
base: './',
plugins: [
react(),
babel({
filter: /\.[jt]sx?$/,
exclude: /node_modules/,
babelConfig: {
presets: ['@babel/preset-typescript'],
plugins: [['babel-plugin-react-compiler', { target: '19' }]],
},
}),
mode !== 'test' && eslint({ failOnError: mode === 'production', failOnWarning: mode === 'production' }),
mode !== 'test' && loggerContextPlugin(),
visualizer(),
],
resolve: {
tsconfigPaths: true,
},
build: {
chunkSizeWarningLimit: 1500,
},
server: {
proxy: {
'/ws/socket.io': {
target: 'ws://127.0.0.1:9090',
ws: true,
},
'/openapi.json': {
target: 'http://127.0.0.1:9090/openapi.json',
rewrite: (path) => path.replace(/^\/openapi.json/, ''),
changeOrigin: true,
},
'/api/': {
target: 'http://127.0.0.1:9090/api/',
rewrite: (path) => path.replace(/^\/api/, ''),
changeOrigin: true,
},
},
host: '0.0.0.0',
},
test: {
reporters: [['default', { summary: false }]],
typecheck: {
enabled: true,
ignoreSourceErrors: true,
},
coverage: {
provider: 'v8',
all: false,
reporter: ['html'],
},
},
};
});