23 lines
511 B
TypeScript
23 lines
511 B
TypeScript
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({
|
|
plugins: [react()],
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
},
|
|
});
|