File tree 3 files changed +12
-1
lines changed 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,16 @@ const hasJsxRuntime = require('./hasJsxRuntime');
12
12
module . exports = function createSwcConfig ( {
13
13
shouldUseSourceMap = true ,
14
14
isEnvDevelopment = false ,
15
+ isEnvProduction = false ,
15
16
shouldUseReactRefresh = false ,
16
17
} = { } ) {
18
+ const env =
19
+ isEnvDevelopment | isEnvProduction
20
+ ? {
21
+ mode : 'entry' ,
22
+ coreJs : 3 ,
23
+ }
24
+ : { } ;
17
25
return {
18
26
ecmascript : {
19
27
sourceMaps : shouldUseSourceMap ,
@@ -31,6 +39,7 @@ module.exports = function createSwcConfig({
31
39
} ,
32
40
} ,
33
41
} ,
42
+ env,
34
43
} ,
35
44
typescript : {
36
45
sourceMaps : shouldUseSourceMap ,
@@ -45,9 +54,11 @@ module.exports = function createSwcConfig({
45
54
react : {
46
55
runtime : hasJsxRuntime ? 'automatic' : 'clasic' ,
47
56
refresh : shouldUseReactRefresh ,
57
+ development : isEnvDevelopment ,
48
58
} ,
49
59
} ,
50
60
} ,
51
61
} ,
62
+ env,
52
63
} ;
53
64
} ;
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ module.exports = function (webpackEnv) {
90
90
const swcConfig = createSwcConfig ( {
91
91
shouldUseSourceMap,
92
92
isEnvDevelopment,
93
+ isEnvProduction,
93
94
shouldUseReactRefresh,
94
95
} ) ;
95
96
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ const modules = require('../../config/modules');
14
14
const createSwcConfig = require ( '../../config/createSwcConfig' ) ;
15
15
const swcConfig = createSwcConfig ( {
16
16
shouldUseSourceMap : true ,
17
- isEnvDevelopment : true ,
18
17
} ) ;
19
18
20
19
module . exports = ( resolve , rootDir , isEjecting ) => {
You can’t perform that action at this time.
0 commit comments