2023-12-08 14:33:22 +01:00
|
|
|
/// <reference types="vitest" />
|
2023-12-16 17:20:59 +01:00
|
|
|
import path from 'path';
|
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
import preact from '@preact/preset-vite';
|
2023-12-08 14:33:22 +01:00
|
|
|
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
define: {
|
|
|
|
'import.meta.vitest': 'undefined',
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
proxy: {
|
|
|
|
'/api': {
|
2023-12-16 00:24:50 +01:00
|
|
|
target: 'http://localhost:5000'
|
2023-12-08 14:33:22 +01:00
|
|
|
},
|
2023-12-16 17:20:59 +01:00
|
|
|
'/vod': {
|
2023-12-16 00:24:50 +01:00
|
|
|
target: 'http://localhost:5000'
|
2023-12-13 03:48:52 +01:00
|
|
|
},
|
2023-12-08 14:33:22 +01:00
|
|
|
'/exports': {
|
2023-12-16 00:24:50 +01:00
|
|
|
target: 'http://localhost:5000'
|
2023-12-08 14:33:22 +01:00
|
|
|
},
|
|
|
|
'/ws': {
|
2023-12-16 00:24:50 +01:00
|
|
|
target: 'ws://localhost:5000',
|
2023-12-08 14:33:22 +01:00
|
|
|
ws: true,
|
|
|
|
},
|
|
|
|
'/live': {
|
2023-12-16 00:24:50 +01:00
|
|
|
target: 'ws://localhost:5000',
|
2023-12-08 14:33:22 +01:00
|
|
|
changeOrigin: true,
|
|
|
|
ws: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
plugins: [
|
2023-12-16 17:20:59 +01:00
|
|
|
preact(),
|
2023-12-08 14:33:22 +01:00
|
|
|
monacoEditorPlugin.default({
|
|
|
|
customWorkers: [{ label: 'yaml', entry: 'monaco-yaml/yaml.worker' }],
|
|
|
|
languageWorkers: ['editorWorkerService'], // we don't use any of the default languages
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
test: {
|
|
|
|
environment: 'jsdom',
|
|
|
|
alias: {
|
|
|
|
'testing-library': path.resolve(__dirname, './__test__/testing-library.js'),
|
|
|
|
},
|
|
|
|
setupFiles: ['./__test__/test-setup.ts'],
|
|
|
|
includeSource: ['src/**/*.{js,jsx,ts,tsx}'],
|
|
|
|
coverage: {
|
|
|
|
reporter: ['text-summary', 'text'],
|
|
|
|
},
|
|
|
|
mockReset: true,
|
|
|
|
restoreMocks: true,
|
|
|
|
globals: true,
|
|
|
|
},
|
2023-12-16 17:20:59 +01:00
|
|
|
});
|