import react from '@vitejs/plugin-react' import { defineConfig } from 'vite' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], build: { rolldownOptions: { output: { codeSplitting: { // Do not pull a group's dependencies into that group. React and the // router must stay in their own cacheable chunks. includeDependenciesRecursively: false, groups: [ { name: 'react-vendor', test: /node_modules[\\/](react|react-dom|scheduler)[\\/]/, }, { name: 'router-vendor', test: /node_modules[\\/]react-router(-dom)?[\\/]/, }, ], }, }, }, }, })