-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathvite.config.ts
More file actions
46 lines (44 loc) · 1.14 KB
/
vite.config.ts
File metadata and controls
46 lines (44 loc) · 1.14 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
import { defineConfig, type PluginOption } from 'vite';
import react from '@vitejs/plugin-react-swc';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import svgrPlugin from 'vite-plugin-svgr';
import { configDefaults } from 'vitest/config';
import { TanStackRouterVite } from '@tanstack/router-vite-plugin';
import { visualizer } from 'rollup-plugin-visualizer';
const manualChunks = (id: string) => {
if (id.includes('@sentry')) {
return 'sentry';
}
};
/* eslint-disable import/no-default-export */
export default defineConfig({
plugins: [
react(),
viteTsconfigPaths(),
svgrPlugin(),
TanStackRouterVite(),
process.env.ANALYZE ? (visualizer({ open: true, gzipSize: true }) as PluginOption) : null,
],
server: {
open: true,
port: 3000,
},
build: {
outDir: 'build',
rollupOptions: {
output: {
manualChunks,
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: 'src/setupTests.ts',
clearMocks: true,
exclude: [...configDefaults.exclude, 'e2e/**/*', 'e2e-playwright/**/*'],
coverage: {
reporter: ['text', 'json', 'html'],
},
},
});