vite.config.ts 676 B

12345678910111213141516171819202122232425
  1. import path from "path";
  2. import { defineConfig, loadEnv } from "vite";
  3. import react from "@vitejs/plugin-react";
  4. import tailwindcss from "@tailwindcss/vite";
  5. export default defineConfig(({ mode }) => {
  6. const env = loadEnv(mode, "./", "");
  7. return {
  8. server: {
  9. port: 3000,
  10. host: "0.0.0.0",
  11. allowedHosts: ["e4578e1fbc59.ngrok-free.app"],
  12. },
  13. plugins: [react(), tailwindcss()],
  14. define: {
  15. "process.env.API_KEY": JSON.stringify(env.GEMINI_API_KEY),
  16. "process.env.GEMINI_API_KEY": JSON.stringify(env.GEMINI_API_KEY),
  17. },
  18. // resolve: {
  19. // alias: {
  20. // '@': path.resolve(__dirname, '.'),
  21. // }
  22. // }
  23. };
  24. });