degmods.com/vite.config.ts
2024-10-15 11:03:35 +02:00

16 lines
506 B
TypeScript

import react from '@vitejs/plugin-react'
import { defineConfig, loadEnv } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
// Load env file based
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
const env = loadEnv(mode, process.cwd(), '')
return {
// vite config
plugins: [react(), tsconfigPaths()],
...(env.VITE_BASE_URL ? { base: env.VITE_BASE_URL } : {})
}
})