vite.config.ts 580 B

1234567891011121314151617181920212223
  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. server: {
  8. port: 3000,
  9. host: '0.0.0.0',
  10. },
  11. plugins: [react()],
  12. define: {
  13. 'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
  14. 'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
  15. },
  16. resolve: {
  17. alias: {
  18. '@': path.resolve(__dirname, '.'),
  19. }
  20. }
  21. };
  22. });