wepee commited on
Commit
b4316e5
·
1 Parent(s): 3170830
Files changed (1) hide show
  1. vite.config.ts +7 -3
vite.config.ts CHANGED
@@ -4,12 +4,15 @@ import tailwindcss from '@tailwindcss/vite';
4
  import react from '@vitejs/plugin-react';
5
  import laravel from 'laravel-vite-plugin';
6
  import { bunny } from 'laravel-vite-plugin/fonts';
7
- import { defineConfig } from 'vite';
8
 
9
- export default defineConfig({
 
 
 
10
  define: {
11
  'import.meta.env.VITE_RAG_API_BASE_URL': JSON.stringify(
12
- process.env.VITE_RAG_API_BASE_URL ?? process.env.RAG_API_BASE_URL ?? '',
13
  ),
14
  },
15
  plugins: [
@@ -33,4 +36,5 @@ export default defineConfig({
33
  formVariants: true,
34
  }),
35
  ],
 
36
  });
 
4
  import react from '@vitejs/plugin-react';
5
  import laravel from 'laravel-vite-plugin';
6
  import { bunny } from 'laravel-vite-plugin/fonts';
7
+ import { defineConfig, loadEnv } from 'vite';
8
 
9
+ export default defineConfig(({ mode }) => {
10
+ const env = loadEnv(mode, process.cwd(), '');
11
+
12
+ return {
13
  define: {
14
  'import.meta.env.VITE_RAG_API_BASE_URL': JSON.stringify(
15
+ env.VITE_RAG_API_BASE_URL || env.RAG_API_BASE_URL || '',
16
  ),
17
  },
18
  plugins: [
 
36
  formVariants: true,
37
  }),
38
  ],
39
+ };
40
  });