mirror of
https://github.com/Tony0410/News-reader-pro.git
synced 2026-05-24 21:31:44 +08:00
Use Vite env key for Gemini
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
// Load env file based on `mode` in the current working directory.
|
||||
const env = loadEnv(mode, (process as any).cwd(), '');
|
||||
|
||||
return {
|
||||
plugins: [react()],
|
||||
define: {
|
||||
// This allows the app code to continue using process.env.API_KEY
|
||||
// even though it is running in the browser.
|
||||
'process.env.API_KEY': JSON.stringify(env.API_KEY)
|
||||
}
|
||||
};
|
||||
export default defineConfig({
|
||||
plugins: [react()]
|
||||
});
|
||||
Reference in New Issue
Block a user