fix(vite): inline FRESH_PUBLIC_* env vars (#3221)

This commit is contained in:
Marvin Hagemeister
2025-08-16 23:14:03 +02:00
committed by GitHub
parent 59549c9532
commit f80d049dca
7 changed files with 203 additions and 7 deletions
@@ -0,0 +1,18 @@
import { useEffect, useState } from "preact/hooks";
export function EnvIsland() {
const [ready, setReady] = useState(false);
useEffect(() => {
setReady(true);
}, []);
const deno = Deno.env.get("FRESH_PUBLIC_FOO");
// deno-lint-ignore no-process-global
const nodeEnv = process.env.FRESH_PUBLIC_FOO;
return (
<div class={ready ? "ready" : ""}>
<pre>{JSON.stringify({ deno,nodeEnv},null,2)}</pre>
</div>
);
}
@@ -0,0 +1,5 @@
import { EnvIsland } from "../../islands/tests/EnvIsland.tsx";
export default function Page() {
return <EnvIsland />;
}