vite.config.ts 510 B

12345678910111213141516171819
  1. import path from 'path';
  2. import { defineConfig, loadEnv } from 'vite';
  3. import react from '@vitejs/plugin-react';
  4. export default defineConfig(({ mode }) => {
  5. const env = loadEnv(mode, '.', '');
  6. return {
  7. plugins: [react()],
  8. define: {
  9. 'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
  10. 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
  11. },
  12. resolve: {
  13. alias: {
  14. '@': path.resolve(__dirname, '.'),
  15. }
  16. }
  17. };
  18. });