Skip to content

Commit

Permalink
docs: add note about complex env based replacement (#14899)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <[email protected]>
  • Loading branch information
patak-dev and bluwy authored Nov 7, 2023
1 parent 3a8d5a4 commit cd9e3e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/guide/env-and-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ Vite also supports replacing env variables in HTML files. Any properties in `imp
If the env doesn't exist in `import.meta.env`, e.g. `%NON_EXISTENT%`, it will be ignored and not replaced, unlike `import.meta.env.NON_EXISTENT` in JS where it's replaced as `undefined`.
Given that Vite is used by many frameworks, it is intentionally unopinionated about complex replacements like conditionals. Vite can be extended using [an existing userland plugin](https://github.com/vitejs/awesome-vite#transformers) or a custom plugin that implements the [`transformIndexHtml` hook](./api-plugin#transformindexhtml).
## Modes
By default, the dev server (`dev` command) runs in `development` mode and the `build` command runs in `production` mode.
Expand Down

0 comments on commit cd9e3e1

Please sign in to comment.