Files
cameleer-server/ui/vite.config.ts

35 lines
843 B
TypeScript
Raw Normal View History

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// Use VITE_API_TARGET to proxy to a remote server, e.g.:
// VITE_API_TARGET=https://api.cameleer.siegeln.net npm run dev
const apiTarget = process.env.VITE_API_TARGET || 'http://localhost:8081';
export default defineConfig({
define: {
__APP_VERSION__: JSON.stringify(process.env.VITE_APP_VERSION || 'dev'),
},
plugins: [react()],
server: {
proxy: {
'/api/': {
target: apiTarget,
changeOrigin: true,
secure: false,
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
proxyReq.removeHeader('origin');
});
},
},
},
},
optimizeDeps: {
include: ['swagger-ui-dist/swagger-ui-bundle'],
},
base: './',
build: {
outDir: 'dist',
},
});