Files
mqtt_explorer/frontend/vite.config.ts
Gilles Soulier 383ad292d3 first
2025-12-24 14:47:39 +01:00

31 lines
745 B
TypeScript
Executable File

import path from 'path';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
return {
server: {
port: 3000,
host: '0.0.0.0',
proxy: {
'/api': 'http://localhost:8088',
'/ws': {
target: 'ws://localhost:8088',
ws: true
}
}
},
plugins: [react()],
define: {
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
}
}
};
});