blakeblackshear.frigate/web/vite.config.ts
Nicolas Mowen 7953d131ae
Fix monaco editor issues (#4724)
* Add sub filter for monaco editor

* Don't include files for unused languages

* Move necessary files and cleanup build

* Update sub filter for new location

* Still need to include default editor worker

* Fix error when model already exists
2022-12-17 17:55:41 -06:00

30 lines
903 B
TypeScript

/// <reference types="vitest" />
import path from "path";
import { defineConfig } from 'vite'
import preact from '@preact/preset-vite'
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
// https://vitejs.dev/config/
export default defineConfig({
define: {
'import.meta.vitest': 'undefined',
},
plugins: [preact(), 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
},
})