-
Notifications
You must be signed in to change notification settings - Fork 20
/
vite.config.ts
48 lines (46 loc) · 1.19 KB
/
vite.config.ts
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
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({
jsxImportSource: '@welldone-software/why-did-you-render',
}),
viteTsconfigPaths(),
svgrPlugin(),
TanStackRouterVite(),
process.env.ANALYZE ? (visualizer({ open: 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'],
},
},
});