Files
Louis King 1a4b58b473 chore(deps): upgrade vite to v8 and @vitejs/plugin-react to v6
Vite 8 replaces Rollup with Rolldown as the bundler engine. This
requires migrating build.rollupOptions to build.rolldownOptions and
the removed object-form manualChunks to the new codeSplitting.groups
API.

Migrate vite.config.ts:
- rollupOptions -> rolldownOptions
- manualChunks object -> codeSplitting.groups with RegExp test patterns
  (vendor: react/react-dom/react-router, i18n: i18next packages)

@vitejs/plugin-react@6 requires vite@^8 as peer dependency, so both
upgrades must land together.

Verified: npm run build succeeds (chunks: vendor 230KB, i18n 55KB),
tsc --noEmit clean, 339/339 vitest tests passing.
2026-07-25 00:10:46 +01:00

42 lines
969 B
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "node:path";
const SPA_REACT = resolve(
__dirname,
"src/meshcore_hub/web/static/js/spa-react",
);
const DIST = resolve(__dirname, "src/meshcore_hub/web/static/dist");
export default defineConfig({
base: "/static/dist/",
plugins: [react()],
resolve: {
alias: {
"@": SPA_REACT,
},
},
build: {
outDir: DIST,
emptyOutDir: true,
manifest: true,
rolldownOptions: {
input: resolve(SPA_REACT, "index.html"),
output: {
codeSplitting: {
groups: [
{
name: "vendor",
test: /[\\/]node_modules[\\/](react|react-dom|react-router)[\\/]/,
},
{
name: "i18n",
test: /[\\/]node_modules[\\/](i18next|react-i18next|i18next-browser-languagedetector)[\\/]/,
},
],
},
},
},
},
});