File tree Expand file tree Collapse file tree 5 files changed +8
-7
lines changed Expand file tree Collapse file tree 5 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,6 @@ module.exports = {
74
74
} ,
75
75
globals : {
76
76
__IS_DEV__ : true ,
77
- __API__ : true ,
77
+ __API__ : '' ,
78
78
} ,
79
79
} ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export interface BuildPaths {
10
10
export interface BuildEnv {
11
11
port : number ;
12
12
mode : BuildMode ;
13
- api : string ;
13
+ apiUrl : string ;
14
14
}
15
15
16
16
export interface BuildOptions {
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export default {
53
53
// A set of global variables that need to be available in all test environments
54
54
globals : {
55
55
__IS_DEV__ : true ,
56
- __API__ : true ,
56
+ __API__ : '' ,
57
57
} ,
58
58
transformIgnorePatterns : [ 'node_modules/(?!axios)' ] ,
59
59
Original file line number Diff line number Diff line change 1
1
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2
- import webpack , { DefinePlugin } from 'webpack' ;
3
2
import path from 'path' ;
3
+ import webpack , { DefinePlugin } from 'webpack' ;
4
4
import { buildCssLoader } from '../build/loaders/buildCssLoader' ;
5
5
import { BuildPaths } from '../build/types/config' ;
6
6
@@ -31,8 +31,8 @@ export default ({ config }: {config: webpack.Configuration}) => {
31
31
config . module ! . rules ! . push ( buildCssLoader ( true ) ) ;
32
32
33
33
config . plugins ! . push ( new DefinePlugin ( {
34
- __IS_DEV__ : true ,
35
- __API__ : true ,
34
+ __IS_DEV__ : JSON . stringify ( true ) ,
35
+ __API__ : JSON . stringify ( '' ) ,
36
36
} ) ) ;
37
37
38
38
return config ;
Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ export default (env: BuildEnv) => {
13
13
14
14
const mode = env . mode || 'development' ;
15
15
const PORT = env . port || 3001 ;
16
+ const apiUrl = env . apiUrl || 'http://localhost:8100' ;
17
+
16
18
const isDev = mode === 'development' ;
17
- const apiUrl = isDev ? 'http://localhost:8100' : 'http://production.com' ;
18
19
19
20
const config : Configuration = buildWebpackConfig ( {
20
21
mode,
You can’t perform that action at this time.
0 commit comments