File tree 1 file changed +10
-16
lines changed
1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ const CORE_PLUGINS = [
71
71
babelPlugin ,
72
72
] ;
73
73
74
+ const browserEnvPlugins = env => {
75
+ return [
76
+ replace ( { 'process.env.NODE_ENV' : JSON . stringify ( env ) } ) ,
77
+ modifyReplacePlugin ,
78
+ terser ( ) ,
79
+ ] ;
80
+ } ;
81
+
74
82
export default [
75
83
/*** COMMONJS ***/
76
84
{
@@ -104,14 +112,7 @@ export default [
104
112
globals,
105
113
name,
106
114
} ,
107
- plugins : [
108
- ...CORE_PLUGINS ,
109
- replace ( {
110
- 'process.env.NODE_ENV' : JSON . stringify ( 'development' ) ,
111
- } ) ,
112
- modifyReplacePlugin ,
113
- terser ( ) ,
114
- ] ,
115
+ plugins : [ ...CORE_PLUGINS , ...browserEnvPlugins ( 'development' ) ] ,
115
116
} ,
116
117
117
118
/*** BROWSER (PRODUCTION) ***/
@@ -124,13 +125,6 @@ export default [
124
125
globals,
125
126
name,
126
127
} ,
127
- plugins : [
128
- ...CORE_PLUGINS ,
129
- replace ( {
130
- 'process.env.NODE_ENV' : JSON . stringify ( 'production' ) ,
131
- } ) ,
132
- modifyReplacePlugin ,
133
- terser ( ) ,
134
- ] ,
128
+ plugins : [ ...CORE_PLUGINS , ...browserEnvPlugins ( 'production' ) ] ,
135
129
} ,
136
130
] ;
You can’t perform that action at this time.
0 commit comments