import { defineConfig } from 'vite' import react, { reactCompilerPreset } from '@vitejs/plugin-react' import babel from '@rolldown/plugin-babel' // Inject the React DevTools standalone hook only during `vite` dev (serve), // so it never ships in a production build. const devtools = () => ({ name: 'react-devtools-dev-only', apply: 'serve' as const, transformIndexHtml: { order: 'pre' as const, handler: (html: string) => html.replace( '', ' \n ', ), }, }) // https://vite.dev/config/ export default defineConfig({ plugins: [ react(), babel({ presets: [reactCompilerPreset()] }), devtools(), ], })