Migrate to Vite+ (vite-plus) unified toolchain

Replace Vite/Vitest with vite-plus, update WASM loading to native Vite 8
?init pattern, switch React compiler to @rolldown/plugin-babel, and
migrate git hooks from husky to vite-hooks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-03-13 07:23:11 -07:00
parent aed7bd12ea
commit 49659a3da9
44 changed files with 1470 additions and 1085 deletions

View File

@@ -1,6 +1,6 @@
// biome-ignore-all lint/suspicious/noTemplateCurlyInString: We're testing this, specifically
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from 'vite-plus/test';
import { parser } from './twig';
function getNodeNames(input: string): string[] {

View File

@@ -1,5 +1,5 @@
import type { HttpResponseEvent } from '@yaakapp-internal/models';
import { describe, expect, test } from 'vitest';
import { describe, expect, test } from 'vite-plus/test';
import { getCookieCounts } from './model_util';
function makeEvent(

View File

@@ -4,8 +4,8 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite dev --force",
"build": "vite build",
"dev": "vp dev --force",
"build": "vp build",
"lint": "tsc --noEmit"
},
"dependencies": {
@@ -77,9 +77,11 @@
},
"devDependencies": {
"@lezer/generator": "^1.8.0",
"@rolldown/plugin-babel": "^0.2.1",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
"@tanstack/router-plugin": "^1.127.5",
"@types/babel__core": "^7.20.5",
"@types/node": "^24.0.13",
"@types/papaparse": "^5.3.16",
"@types/parse-color": "^1.0.3",
@@ -88,18 +90,17 @@
"@types/react-syntax-highlighter": "^15.5.13",
"@types/uuid": "^10.0.0",
"@types/whatwg-mimetype": "^3.0.2",
"babel-plugin-react-compiler": "^1.0.0",
"@vitejs/plugin-react": "^6.0.0",
"autoprefixer": "^10.4.21",
"babel-plugin-react-compiler": "^1.0.0",
"decompress": "^4.2.1",
"internal-ip": "^8.0.0",
"postcss": "^8.5.6",
"postcss-nesting": "^13.0.2",
"tailwindcss": "^3.4.17",
"vite": "^8.0.0",
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vite-plugin-static-copy": "^3.3.0",
"vite-plugin-svgr": "^4.5.0",
"vite-plugin-top-level-await": "^1.6.0",
"vite-plugin-wasm": "^3.5.0"
"vite-plus": "latest"
}
}

View File

@@ -11,7 +11,7 @@
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,

View File

@@ -2,9 +2,10 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"noUncheckedIndexedAccess": true
"noUncheckedIndexedAccess": true,
"skipLibCheck": true
},
"include": ["vite.config.ts"]
}

View File

@@ -1 +1 @@
/// <reference types="vite/client" />
/// <reference types="vite-plus/client" />

View File

@@ -1,13 +1,12 @@
// @ts-ignore
import { tanstackRouter } from '@tanstack/router-plugin/vite';
import react from '@vitejs/plugin-react';
import babel from '@rolldown/plugin-babel';
import react, { reactCompilerPreset } from '@vitejs/plugin-react';
import { createRequire } from 'node:module';
import path from 'node:path';
import { defineConfig, normalizePath } from 'vite';
import { defineConfig, normalizePath } from 'vite-plus';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import svgr from 'vite-plugin-svgr';
import topLevelAwait from 'vite-plugin-top-level-await';
import wasm from 'vite-plugin-wasm';
const require = createRequire(import.meta.url);
const cMapsDir = normalizePath(
@@ -18,10 +17,9 @@ const standardFontsDir = normalizePath(
);
// https://vitejs.dev/config/
export default defineConfig(async () => {
return {
export default defineConfig(
{
plugins: [
wasm(),
tanstackRouter({
target: 'react',
routesDirectory: './routes',
@@ -29,12 +27,10 @@ export default defineConfig(async () => {
autoCodeSplitting: true,
}),
svgr(),
react({
babel: {
plugins: ['babel-plugin-react-compiler'],
},
react(),
babel({
presets: [reactCompilerPreset()],
}),
topLevelAwait(),
viteStaticCopy({
targets: [
{ src: cMapsDir, dest: '' },
@@ -61,5 +57,4 @@ export default defineConfig(async () => {
strictPort: true,
},
envPrefix: ['VITE_', 'TAURI_'],
};
});