23 lines
611 B
TypeScript
23 lines
611 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
// Keep bundle sizes manageable (and make caching better) by splitting common deps.
|
|
manualChunks(id) {
|
|
if (!id.includes('node_modules')) return
|
|
|
|
// Keep this match tight: many packages contain "react" in their name.
|
|
if (/node_modules[\\/](react|react-dom|scheduler)[\\/]/.test(id)) return 'react'
|
|
|
|
return 'vendor'
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|