Match isProduction definitions

Summary:
Match isProduction definition in flipper-common and flipper-server/src/index.tsx.

Without it, PWA never quits after all clients disconnect because Flipper Launcher does not set NODE_ENV to production currently (changed in the next diff)

Reviewed By: LukeDefeo, lblasa

Differential Revision: D48265768

fbshipit-source-id: 59e4660cb57da20b606562144c47c65276999d6c
This commit is contained in:
Andrey Goncharov
2023-08-11 10:56:38 -07:00
committed by Facebook GitHub Bot
parent b5ed57b7d0
commit 359392a44c

View File

@@ -13,6 +13,7 @@ declare const process: any;
// this one, and one provided by the RenderHostConfig. Ideally they should be unified
export function isProduction(): boolean {
return (
typeof process === 'undefined' || process.env.NODE_ENV === 'production'
typeof process === 'undefined' ||
(process.env.NODE_ENV !== 'development' && process.env.NODE_ENV !== 'test')
);
}