14 lines
429 B
TypeScript
14 lines
429 B
TypeScript
import { defineConfig, loadEnv } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, (process as any).cwd(), '');
|
|
return {
|
|
plugins: [react()],
|
|
define: {
|
|
// Define process.env.API_KEY during build time to support the existing code structure
|
|
'process.env.API_KEY': JSON.stringify(env.API_KEY)
|
|
}
|
|
}
|
|
}) |