Skip to content

Commit

Permalink
change NODE_ENV -> MODE for vite
Browse files Browse the repository at this point in the history
  • Loading branch information
appleseed-iii committed Dec 13, 2022
1 parent c6a179e commit a755708
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)}.`,
);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useGoogleAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
{
Expand Down
4 changes: 2 additions & 2 deletions src/lib/react-query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => (
<QueryClientProvider client={queryClient}>
{Environment.env.NODE_ENV === "development" && <ReactQueryDevtools />}
{Environment.env.MODE === "development" && <ReactQueryDevtools />}

{children}
</QueryClientProvider>
Expand Down

0 comments on commit a755708

Please sign in to comment.