Adds @shibomb's check to see if process.env is defined for node environments, but also falls back on import.meta.env for non-SSR components hydrated in the browser. To do this, the env vars are written to a .env file that Astro reads, and the vars that need to be read in the browser have to have a PUBLIC_ prefix for Astro to pass them through.
Also makes more schema things optional for dev builds and corrects the cleanup script from removing those changes (it was cleaning up the whole reference folder instead of just the content in reference/en/, oops)
Resolves https://github.com/processing/p5.js-website/issues/627
Adds @shibomb's check to see if
process.env
is defined for node environments, but also falls back onimport.meta.env
for non-SSR components hydrated in the browser. To do this, the env vars are written to a .env file that Astro reads, and the vars that need to be read in the browser have to have aPUBLIC_
prefix for Astro to pass them through.Also makes more schema things optional for dev builds and corrects the cleanup script from removing those changes (it was cleaning up the whole
reference
folder instead of just the content inreference/en/
, oops)