Files
InvokeAI/invokeai/frontend/web/vite.config.mts
Jonathan be015a5434 Run vitest during frontend build (#9022)
* Run vitest during frontend build

* Add frontend-test Make target
2026-04-05 19:18:24 -04:00

55 lines
1.4 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 tsconfigPaths from 'vite-tsconfig-paths';
import { loggerContextPlugin } from './vite-plugin-logger-context';
export default defineConfig(({ mode }) => {
return {
base: './',
plugins: [
react(),
mode !== 'test' && eslint({ failOnError: mode === 'production', failOnWarning: mode === 'production' }),
tsconfigPaths(),
mode !== 'test' && loggerContextPlugin(),
visualizer(),
],
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'],
},
},
};
});