File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import { UserData } from '../../types/models';
44
55type SetStateCallback < T > = ( value : T | ( ( prevValue : T ) => T ) ) => void ;
66
7- const baseUrl : string = process . env . VITE_API_URI || location . origin ;
8-
7+ const baseUrl = process . env . VITE_API_URI || location . origin ;
98const config = {
109 withCredentials : true ,
1110} ;
Original file line number Diff line number Diff line change 1- import { defineConfig } from 'vite' ;
1+ import { defineConfig , loadEnv } from 'vite' ;
22import react from '@vitejs/plugin-react' ;
33
4- export default defineConfig ( {
5- build : {
6- outDir : 'build' ,
7- } ,
8- server : {
9- port : 3000 ,
10- } ,
11- plugins : [ react ( ) ] ,
12- } ) ;
4+ export default ( { mode } : { mode : string } ) => {
5+ const env = loadEnv ( mode , process . cwd ( ) , '' ) ;
6+ return defineConfig ( {
7+ build : {
8+ outDir : 'build' ,
9+ } ,
10+ server : {
11+ port : 3000 ,
12+ } ,
13+ plugins : [ react ( ) ] ,
14+ define : {
15+ 'process.env' : JSON . stringify ( env ) ,
16+ } ,
17+ } ) ;
18+ } ;
You can’t perform that action at this time.
0 commit comments