File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ import mock from './build/mock/createMockServer'
2020export default ( { command, mode } : ConfigEnv ) : UserConfig => {
2121 const root = process . cwd ( )
2222 const env = loadEnv ( mode , root )
23-
23+ const isHttpMock = env . VITE_HTTP_MOCK === 'true'
24+ const isViteMock = env . VITE_MOCK === 'true'
2425 return {
2526 base : env . VITE_APP_PUBLIC_PATH ,
2627
@@ -72,7 +73,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
7273 watch : true ,
7374 mockUrlList : [ / a p i / ] ,
7475 cwd : process . cwd ( ) ,
75- enable : env . VITE_HTTP_MOCK && env . VITE_MOCK && process . env . NODE_ENV !== 'production' ,
76+ enable : isHttpMock && isViteMock && process . env . NODE_ENV !== 'production' ,
7677 } ) ,
7778 ] ,
7879
@@ -103,7 +104,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
103104 server : {
104105 host : true ,
105106 port : 3000 ,
106- proxy : env . VITE_HTTP_MOCK && env . VITE_MOCK && process . env . NODE_ENV !== 'production'
107+ proxy : isHttpMock && isViteMock && process . env . NODE_ENV !== 'production'
107108 ? undefined
108109 : {
109110 '/api' : {
You can’t perform that action at this time.
0 commit comments