Files

20 lines
654 B
TypeScript

import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { vcBabelLoc } from './vc/inspector';
// Deploy owns `base` and the /api proxy. Changing them here breaks the deployed
// app while dev keeps working — the worst kind of change to make.
// `vc/` is DevVibeCoder's Design mode: source-location stamps, dev server only.
export default defineConfig(({ command }) => ({
plugins: [react(command === 'serve' ? { babel: { plugins: [vcBabelLoc] } } : {})],
server: {
proxy: {
'/api': {
target: process.env.VITE_API_URL || 'http://localhost:8000',
changeOrigin: true,
},
},
},
}));