-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
41 lines (40 loc) · 1.05 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
import path from 'path'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vitest/config'
import million from 'million/compiler'
export default defineConfig({
plugins: [million.vite({ auto: true }), react()],
server: {
port: 5173,
strictPort: true,
host: true,
},
build: {
sourcemap: true,
rollupOptions: {
output: {
manualChunks(id) {
if (id.endsWith('countries.ts')) return 'data'
if (id.includes('country-flags-svg')) return 'data'
if (id.endsWith('.json')) return 'data'
if (id.includes('chart.js')) return 'charts'
if (id.includes('react-chartjs-2')) return 'charts'
if (id.includes('node_modules')) return 'vendor'
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
test: {
css: true,
globals: true,
environment: 'jsdom',
testTimeout: 2000,
setupFiles: path.resolve(__dirname, './test/vitest-setup.ts'),
include: ['**/*.test.tsx', '**/*.test.ts'],
},
})