25 lines
743 B
TypeScript
25 lines
743 B
TypeScript
import { defineConfig, loadEnv } from 'vite'
|
|
import react from '@vitejs/plugin-react-swc'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ command, mode }) => {
|
|
// Load env file based on `mode` in the current working directory.
|
|
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
|
|
return {
|
|
plugins: [react()],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/metadata': {
|
|
target: env['OBSIDIAN_BEACHHEAD_SERVER']
|
|
},
|
|
'/search': {
|
|
target: env['OBSIDIAN_BEACHHEAD_SERVER']
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|