-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
34 lines (32 loc) · 889 Bytes
/
Copy pathvite.config.ts
File metadata and controls
34 lines (32 loc) · 889 Bytes
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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
// Matches the GitHub Pages path, so dev and production share the same base.
export default defineConfig({
plugins: [react()],
base: '/pokedexreact/',
server: {
host: true,
open: false,
strictPort: true,
port: 5173,
},
test: {
environment: 'node',
include: ['src/**/*.test.ts'],
},
build: {
rollupOptions: {
output: {
manualChunks(id: string) {
if (!id.includes('node_modules')) return
if (id.includes('chart.js') || id.includes('react-chartjs-2')) return 'chart'
if (id.includes('framer-motion')) return 'motion'
if (id.includes('react-router')) return 'router'
if (id.includes('styled-components')) return 'styled'
if (id.includes('/react-dom/') || id.includes('/react/')) return 'react'
},
},
},
},
})