-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose environment variables also on import.meta.env (#8928)
For compatability with webpack, and for consistency with node/server environment we want to support reading env vars from `process.env`. But we also want to support Vite's way of doing it, which is exposing them on `import.meta.env`. And this is a copy/paste from the code ``` // Vite can automatically expose environment variables, but we // disable that in `buildFeServer.ts` by setting `envFile: false` // because we want to use our own logic for loading .env, // .env.defaults, etc // The two object spreads below will expose all environment // variables listed in redwood.toml and all environment variables // prefixed with REDWOOD_ENV_ ``` Note: This does not work for Vite's html `%%` replacement because of vitejs/vite#13424 But we've got a separate PR that takes care of that in #8929
- Loading branch information
Showing
3 changed files
with
69 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters