-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.mts
More file actions
81 lines (79 loc) · 2.25 KB
/
vite.config.mts
File metadata and controls
81 lines (79 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// SPDX-FileCopyrightText: 2024 German Aerospace Center (DLR)
// SPDX-License-Identifier: CC0-1.0
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
import preload from 'unplugin-inject-preload/vite';
import eslintPlugin from '@nabla/vite-plugin-eslint';
export default defineConfig(() => {
return {
assetsInclude: ['**/*.md', '**/*.geojson', '**/*.json5'],
base: './',
plugins: [
react(),
eslintPlugin(),
tsconfigPaths(),
preload({
files: [
{
entryMatch: /(LOKI_compact)+.+(.svg)$/,
attributes: {as: 'image'},
},
{
entryMatch: /(lk_germany_reduced)+.+(.geojson)$/,
attributes: {as: 'fetch', crossOrigin: 'anonymous'},
},
{
entryMatch: /(lk_germany_reduced_list)+.+(.json)$/,
attributes: {as: 'fetch', crossOrigin: 'anonymous'},
},
],
}),
],
build: {
assetsInlineLimit: 0,
rollupOptions: {
output: {
manualChunks: {
react: ['react', 'react-dom', 'redux', 'react-redux', '@reduxjs/toolkit', 'redux-persist'],
amCharts: ['@amcharts/amcharts5'],
mui: [
'@emotion/react',
'@emotion/styled',
'@mui/icons-material',
'@mui/lab',
'@mui/material',
'@mui/system',
'@mui/x-date-pickers',
],
i18n: ['i18next', 'react-i18next', 'i18next-browser-languagedetector', 'i18next-http-backend'],
markdown: ['react-markdown', 'rehype-katex', 'remark-math'],
misc: [
'dayjs',
'react-lazyload',
'react-joyride',
'react-oauth2-code-pkce',
'react-scroll-sync',
'json5',
'rooks',
],
},
},
},
},
test: {
environment: 'jsdom',
setupFiles: './test/setup.ts',
coverage: {
reporter: ['text', 'clover'],
reportsDirectory: 'reports',
},
threads: false,
server: {
deps: {
inline: ['vitest-canvas-mock'],
},
},
},
};
});