tianji/src/client/vite.config.ts

42 lines
877 B
TypeScript
Raw Normal View History

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
2024-03-17 16:57:02 +00:00
import { resolve } from 'path';
2024-03-20 18:00:23 +00:00
import { TanStackRouterVite } from '@tanstack/router-vite-plugin';
// https://vitejs.dev/config/
export default defineConfig({
root: __dirname,
2024-03-20 18:00:23 +00:00
plugins: [
react(),
TanStackRouterVite({
routesDirectory: './routes',
generatedRouteTree: './routeTree.gen.ts',
}),
],
build: {
outDir: '../server/public',
},
2024-03-17 16:57:02 +00:00
resolve: {
alias: {
'@': resolve(__dirname, './'),
},
},
clearScreen: false,
server: {
// host: '0.0.0.0',
proxy: {
'/socket.io': {
target: 'ws://localhost:12345',
changeOrigin: true,
ws: true,
},
'/trpc': {
target: 'http://localhost:12345',
},
'/api/workspace': {
target: 'http://localhost:12345',
},
},
},
});