nexus/ui/vite.config.ts
Mikkel Georgsen 453a1ab54d fix(05-01): switch Vite alias to array syntax with RegExp find pattern
- Replace object alias syntax with array of {find, replacement} entries
- '@' and 'lexical' aliases preserved as string find entries
- OnboardingWizard alias uses RegExp /^\.\/components\/OnboardingWizard$/ find
- RegExp matches raw import specifier from App.tsx in both dev and prod modes
2026-04-02 15:08:37 +00:00

33 lines
1,001 B
TypeScript

import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: [
{ find: "@", replacement: path.resolve(__dirname, "./src") },
{
find: "lexical",
replacement: path.resolve(__dirname, "./node_modules/lexical/Lexical.mjs"),
},
// [nexus] Replace upstream OnboardingWizard with Nexus single-step version.
// RegExp required: string keys match the RAW import specifier (not resolved path).
// App.tsx imports './components/OnboardingWizard' — must match exactly.
{
find: /^\.\/components\/OnboardingWizard$/,
replacement: path.resolve(__dirname, "./src/components/NexusOnboardingWizard"),
},
],
},
server: {
port: 5173,
proxy: {
"/api": {
target: "http://localhost:3100",
ws: true,
},
},
},
});