obsidian-note-finder/vite.config.ts
2023-10-13 21:00:11 +01:00

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']
}
}
}
}
})