Skip to content

Commit 8f77b07

Browse files
authored
feat(types): make ImportMetaEnv strictly available (#1893)
1 parent da970ca commit 8f77b07

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

guide/env-and-mode.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ VITE_BAR=bar
108108
```typescript [vite-env.d.ts]
109109
/// <reference types="vite/client" />
110110

111+
interface ViteTypeOptions {
112+
// この行を追加することで ImportMetaEnv の型を厳密にし、不明なキーを許可しないように
113+
// できます。
114+
// strictImportMetaEnv: unknown
115+
}
116+
111117
interface ImportMetaEnv {
112118
readonly VITE_APP_TITLE: string
113119
// その他の環境変数...

0 commit comments

Comments
 (0)