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';
4
4
5
5
type SetStateCallback < T > = ( value : T | ( ( prevValue : T ) => T ) ) => void ;
6
6
7
- const baseUrl : string = process . env . VITE_API_URI || location . origin ;
8
-
7
+ const baseUrl = process . env . VITE_API_URI || location . origin ;
9
8
const config = {
10
9
withCredentials : true ,
11
10
} ;
Original file line number Diff line number Diff line change 1
- import { defineConfig } from 'vite' ;
1
+ import { defineConfig , loadEnv } from 'vite' ;
2
2
import react from '@vitejs/plugin-react' ;
3
3
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