-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
34 lines (32 loc) · 1.02 KB
/
Copy pathvite.config.ts
File metadata and controls
34 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import path from 'path';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import basicSsl from '@vitejs/plugin-basic-ssl';
export default defineConfig(({ mode }) => {
// Load env file based on `mode` in the current working directory.
// The third parameter '' makes all env variables available, even without the VITE_ prefix.
const env = loadEnv(mode, process.cwd(), '');
return {
base: './',
server: {
port: 3000,
host: '0.0.0.0',
},
plugins: [
react(),
// This plugin automatically creates and uses a self-signed
// SSL certificate to enable HTTPS in the dev server.
basicSsl()
],
define: {
// Map the GEMINI_API_KEY from the .env file to the process.env.API_KEY
// that the application code expects.
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
}
}
};
});