astro/examples/env-vars
Nate Moore 39cbe50085
Expose private .env variables to import.meta.env during SSR (#2612)
* chore(examples): add env-vars example

* feat: improve import.meta.env support

* chore: add changeset

* test: update astro-envs test

* refactor: cleanup code based on feedback

* fix: import.meta guard

* fix: update memory test threshold to 10%
2022-02-18 16:06:56 -06:00
..
public Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
src Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
.env Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
.gitignore Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
.npmrc Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
.stackblitzrc Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
astro.config.mjs Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
package.json Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
README.md Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
sandbox.config.json Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00
tsconfig.json Expose private .env variables to import.meta.env during SSR (#2612) 2022-02-18 16:06:56 -06:00

Astro Starter Kit: Environment Variables

npm init astro -- --template env-vars

Open in StackBlitz

This example showcases Astro's support for Environment Variables. Please see Vite's Env Variables and Modes guide for more information.