-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (39 loc) · 1.02 KB
/
Copy pathvite.config.ts
File metadata and controls
41 lines (39 loc) · 1.02 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
import { readFileSync } from 'fs'
import { fileURLToPath } from 'url'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'))
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
svgr(),
react(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
base: '/',
build: {
// Largest chunk is pdfExport (~1651 kB due to jsPDF + base64 fonts).
// These are already code-split via dynamic import; suppress the warning.
chunkSizeWarningLimit: 1700,
target: 'es2022',
outDir: 'dist',
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom'],
'date-vendor': ['date-fns', 'date-holidays'],
'pdf-export': ['jspdf', 'svg2pdf.js'],
},
},
},
},
})