mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-24 02:39:19 -05:00
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
// Import the package.json to get the version
|
|
import { readFileSync } from 'fs';
|
|
|
|
// Get package.json version
|
|
const packageJson = JSON.parse(readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8'));
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
base: './', // Use relative paths for assets
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
define: {
|
|
// Make package version available as global variable
|
|
'import.meta.env.PACKAGE_VERSION': JSON.stringify(packageJson.version),
|
|
},
|
|
build: {
|
|
sourcemap: true, // Enable source maps for production build
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
},
|
|
'/auth': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|