初始化项目;更新至 v0.1.0_20251209 版本
This commit is contained in:
21
vite.config.ts
Normal file
21
vite.config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, '.', '');
|
||||
return {
|
||||
plugins: [react()],
|
||||
define: {
|
||||
'process.env.API_KEY': JSON.stringify(process.env.API_KEY || env.API_KEY)
|
||||
},
|
||||
server: {
|
||||
port: 8080,
|
||||
host: '0.0.0.0'
|
||||
},
|
||||
preview: {
|
||||
port: 8080,
|
||||
host: '0.0.0.0',
|
||||
allowedHosts: true
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user