mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
58a2dca228
* fix: serialize route pattern for Netlify edge Co-authored-by: Jackie Macharia <jackiewmacharia> * fix: escape import.meta.env in MDX compiler output * test: env vars in mdx * chore: changeset * deps: estree-util-visit, @types/estree * feat: inject import.meta.env w/ recma * feat: pull importMetaEnv from vite + astro configs * test: `import.meta.env` in JSX * fix: lockfile * chore: update changeset * fix: remove stray stashed commit
812 B
812 B
title |
---|
Let's talk about my import.meta.env.SITE |
export const modeWorks = import.meta.env.MODE === 'production' ? 'MODE works' : 'MODE does not work!';
About my import.meta.env.SITE
My import.meta.env.SITE
is so cool, I can put env variables in code!
const site = import.meta.env.SITE;
But I can use import.meta.env properly too
I can compute my site, for example: {new URL('/blog/cool-post', import.meta.env.SITE)}
I can also use import.meta.env
in variable exports: {modeWorks}
I can also use vars as HTML attributes: