fix(vite): inline FRESH_PUBLIC_* env vars (#3221)
This commit is contained in:
@@ -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 />;
|
||||
}
|
||||
Reference in New Issue
Block a user