From a7557086d90e76fa035e90490a95f77d0d8d51f5 Mon Sep 17 00:00:00 2001 From: appleseed-iii Date: Tue, 13 Dec 2022 14:16:09 -0600 Subject: [PATCH] change NODE_ENV -> MODE for vite --- babel.config.js | 2 +- src/helpers/index.tsx | 2 +- src/hooks/useGoogleAnalytics.ts | 2 +- src/lib/react-query.tsx | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/babel.config.js b/babel.config.js index ac4b6d786f..586e8d5bda 100644 --- a/babel.config.js +++ b/babel.config.js @@ -9,7 +9,7 @@ module.exports = api => { if (!validEnv.includes(currentEnv)) { throw new Error( - `Please specify a valid 'NODE_ENV' or 'BABEL_ENV' environment variables. Valid values are "development", "test", and "production". Instead, received: ${JSON.stringify( + `Please specify a valid 'MODE' or 'BABEL_ENV' environment variables. Valid values are "development", "test", and "production". Instead, received: ${JSON.stringify( currentEnv, )}.`, ); diff --git a/src/helpers/index.tsx b/src/helpers/index.tsx index 70f5c19ee2..57e5d2f008 100644 --- a/src/helpers/index.tsx +++ b/src/helpers/index.tsx @@ -90,7 +90,7 @@ export function shouldTriggerSafetyCheck() { } export const handleContractError = (e: any) => { - if (Environment.env.NODE_ENV !== "production") console.warn("caught error in slices; usually network related", e); + if (Environment.env.MODE !== "production") console.warn("caught error in slices; usually network related", e); }; /** diff --git a/src/hooks/useGoogleAnalytics.ts b/src/hooks/useGoogleAnalytics.ts index 22c7cead14..855a90e7ba 100644 --- a/src/hooks/useGoogleAnalytics.ts +++ b/src/hooks/useGoogleAnalytics.ts @@ -21,7 +21,7 @@ const useGoogleAnalytics = () => { }, address ? { userId: address } : {}, ); - if (import.meta.env.NODE_ENV !== "test") { + if (import.meta.env.MODE !== "test") { if (GA4_API_KEY && GA4_API_KEY.length > 1) { GA4.initialize([ { diff --git a/src/lib/react-query.tsx b/src/lib/react-query.tsx index a24ebc9aad..2d26a8403e 100644 --- a/src/lib/react-query.tsx +++ b/src/lib/react-query.tsx @@ -17,14 +17,14 @@ export const queryClient = new QueryClient({ refetchInterval: false, refetchOnReconnect: false, refetchOnWindowFocus: false, - retry: Environment.env.NODE_ENV === "development" ? false : 3, + retry: Environment.env.MODE === "development" ? false : 3, }, }, }); export const ReactQueryProvider: React.FC = ({ children }) => ( - {Environment.env.NODE_ENV === "development" && } + {Environment.env.MODE === "development" && } {children}