Skip to content

Commit

Permalink
docs: env expand feature only works for variables in env files
Browse files Browse the repository at this point in the history
resolve #1607

vitejs/vite@e9c9767 の反映です。
  • Loading branch information
shuuji3 committed Oct 15, 2024
1 parent 0a29b8b commit 8312a75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guide/env-and-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ console.log(import.meta.env.DB_PASSWORD) // undefined
上に示したように、`VITE_SOME_KEY` は数値ですが、パースすると文字列が返ります。同じことはブール型の環境変数にも起こります。コード内で使用する場合には、必ず目的の型に変換するようにしてください。
:::
また、Vite は [dotenv-expand](https://github.com/motdotla/dotenv-expand) を使って、設定不要で変数を展開できます。構文の詳細については、[ドキュメント](https://github.com/motdotla/dotenv-expand#what-rules-does-the-expansion-engine-follow)を参照してください。
また、Vite は [dotenv-expand](https://github.com/motdotla/dotenv-expand) を使って、設定不要で env ファイルに書かれた変数を展開できます。構文の詳細については、[ドキュメント](https://github.com/motdotla/dotenv-expand#what-rules-does-the-expansion-engine-follow)を参照してください。
環境値の中で `$` を使用する場合は、`\` でエスケープする必要があることに注意してください。
Expand Down

0 comments on commit 8312a75

Please sign in to comment.