From 3bd7b630280c7e503ea68260c3a0b31ff2007b5b Mon Sep 17 00:00:00 2001 From: Benjamin Akar Date: Sat, 4 Jun 2022 16:18:10 +0200 Subject: [PATCH] refactor: switch from process.env to import.meta.env --- apps/landing/src/components/HomeCTA.tsx | 2 +- apps/landing/src/pages/index.tsx | 2 +- apps/landing/tsconfig.json | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/landing/src/components/HomeCTA.tsx b/apps/landing/src/components/HomeCTA.tsx index d5c119037..24a74ad76 100644 --- a/apps/landing/src/components/HomeCTA.tsx +++ b/apps/landing/src/components/HomeCTA.tsx @@ -16,7 +16,7 @@ export function HomeCTA() { const [waitlistEmail, setWaitlistEmail] = useState(''); const [fire, setFire] = useState(false); - const prod = process.env.NODE_ENV === 'production'; + const prod = import.meta.env.NODE_ENV === 'production'; const url = prod ? 'https://waitlist-api.spacedrive.com' : 'http://localhost:3000'; async function handleWaitlistSubmit(e: FormEvent) { diff --git a/apps/landing/src/pages/index.tsx b/apps/landing/src/pages/index.tsx index cb1b21976..c60f7a90b 100644 --- a/apps/landing/src/pages/index.tsx +++ b/apps/landing/src/pages/index.tsx @@ -50,7 +50,7 @@ function Page() { if (!cuid) return; (async () => { - const prod = process.env.NODE_ENV === 'production'; + const prod = import.meta.env.NODE_ENV === 'production'; const url = prod ? 'https://waitlist-api.spacedrive.com' : 'http://localhost:3000'; const req = await fetch(`${url}/api/waitlist?i=${cuid}`, { diff --git a/apps/landing/tsconfig.json b/apps/landing/tsconfig.json index fb53fe0cf..ab7e2dd54 100644 --- a/apps/landing/tsconfig.json +++ b/apps/landing/tsconfig.json @@ -1,10 +1,6 @@ { "extends": "../../packages/config/interface.tsconfig.json", - "compilerOptions": { - "types": [ - "node" - ] - }, + "compilerOptions": {}, "include": [ "src" ]