@@ -38,9 +38,7 @@ import {
3838 MockedEventEmitter ,
3939 makeStringifySafeMutations ,
4040 mergeState ,
41- IS_DEVELOPMENT ,
4241 IS_TEST ,
43- IS_PRODUCTION ,
4442 IS_OPERATOR ,
4543 getFunctionName ,
4644 getActionPaths ,
@@ -211,7 +209,7 @@ export class Overmind<ThisConfig extends IConfiguration>
211209 const name = options . name || 'OvermindApp'
212210
213211 if (
214- IS_DEVELOPMENT &&
212+ ( ! process . env . NODE_ENV || process . env . NODE_ENV === 'development' ) &&
215213 mode . mode === MODE_DEFAULT &&
216214 options . hotReloading !== false &&
217215 ! ( process && process . title && process . title . includes ( 'node' ) )
@@ -238,7 +236,7 @@ export class Overmind<ThisConfig extends IConfiguration>
238236 const proxyStateTree = this . createProxyStateTree (
239237 configuration ,
240238 eventHub ,
241- mode . mode === MODE_SSR ? false : IS_DEVELOPMENT
239+ mode . mode === MODE_SSR ? false : process . env . NODE_ENV === 'development'
242240 )
243241
244242 this . originalConfiguration = configuration
@@ -253,7 +251,7 @@ export class Overmind<ThisConfig extends IConfiguration>
253251 }
254252
255253 if (
256- IS_DEVELOPMENT &&
254+ process . env . NODE_ENV === 'development' &&
257255 mode . mode === MODE_DEFAULT &&
258256 typeof window !== 'undefined'
259257 ) {
@@ -302,7 +300,7 @@ export class Overmind<ThisConfig extends IConfiguration>
302300 }
303301 }
304302
305- if ( IS_PRODUCTION && mode . mode === MODE_DEFAULT ) {
303+ if ( process . env . NODE_ENV === 'production' && mode . mode === MODE_DEFAULT ) {
306304 eventHub . on ( EventType . OPERATOR_ASYNC , ( ) => {
307305 proxyStateTree . getMutationTree ( ) . flush ( true )
308306 } )
@@ -389,7 +387,7 @@ export class Overmind<ThisConfig extends IConfiguration>
389387 return proxyStateTree
390388 }
391389 private createExecution ( name , action , parentExecution ) {
392- if ( IS_PRODUCTION ) {
390+ if ( process . env . NODE_ENV === 'production' ) {
393391 return ( {
394392 [ EXECUTION ] : true ,
395393 parentExecution,
@@ -483,7 +481,7 @@ export class Overmind<ThisConfig extends IConfiguration>
483481 boundExecution =
484482 boundExecution && boundExecution [ EXECUTION ] ? boundExecution : undefined
485483
486- if ( IS_PRODUCTION || action [ IS_OPERATOR ] ) {
484+ if ( process . env . NODE_ENV === 'production' || action [ IS_OPERATOR ] ) {
487485 const execution = this . createExecution ( name , action , boundExecution )
488486 this . eventHub . emit ( EventType . ACTION_START , {
489487 ...execution ,
@@ -622,7 +620,7 @@ export class Overmind<ThisConfig extends IConfiguration>
622620 return actionFunc
623621 }
624622 private trackEffects ( effects = { } , execution ) {
625- if ( IS_PRODUCTION ) {
623+ if ( process . env . NODE_ENV === 'production' ) {
626624 return effects
627625 }
628626
@@ -799,7 +797,7 @@ export class Overmind<ThisConfig extends IConfiguration>
799797 } else if ( typeof value === 'function' ) {
800798 aggr [ key ] = new Derived ( value )
801799
802- if ( IS_DEVELOPMENT ) {
800+ if ( process . env . NODE_ENV === 'development' ) {
803801 this . derivedReferences . push ( aggr [ key ] )
804802 }
805803 } else {
0 commit comments