Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

import path from "path";
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
import { defineConfig, type PluginOption } from 'vite'
import react from '@vitejs/plugin-react-swc'
import path from 'path'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), TanStackRouterVite()],
define: {
"process.env": {},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
export default defineConfig(({ command }) => {
const plugins: PluginOption[] = [react()]

// This will only enable the TanStack Router plugin for the 'serve' (dev)
// command. The 'build' command will not run the plugin, and will instead
// use the existing `routeTree.gen.ts` file from your repository.
if (command === 'serve') {
plugins.push(TanStackRouterVite())
}

return {
plugins,
define: {
'process.env': {},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
watch: {
ignored: ['**/src/routeTree.gen.ts'],
},
},
},
});
}
})