Skip to content

Commit 903b52f

Browse files
authored
docs(Vite의 환경 변수와 모드): 잘못된 코드 예제 수정 (#1456)
Fix comment for strictImportMetaEnv in ViteTypeOptions Correct the comment to reflect the accurate property name for strict type checking.
1 parent 34a58ec commit 903b52f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guide/env-and-mode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ VITE_BAR=bar
111111
interface ViteTypeOptions {
112112
// 아래 라인을 추가하면, ImportMetaEnv 타입을 엄격하게 설정해
113113
// 알 수 없는 키를 허용하지 않게 할 수 있습니다.
114-
// strictImportEnv: unknown
114+
// strictImportMetaEnv: unknown
115115
}
116116

117117
interface ImportMetaEnv {
@@ -211,4 +211,4 @@ NODE_ENV=development
211211
`NODE_ENV=...`는 명령뿐 아니라, `.env` 파일에서도 설정할 수 있습니다. 따라서 만약 `.env.[mode]` 파일에서 `NODE_ENV`가 설정되어 있다면, 모드를 통해서도 이를 제어할 수 있습니다. 그러나 `NODE_ENV`와 모드는 여전히 두 개의 다른 개념이라는 것을 유의하세요.
212212
213213
명령에서 `NODE_ENV=...`를 사용하는 주된 이점은, Vite가 그 값을 조기에 감지할 수 있다는 것입니다. Vite는 설정 파일이 분석되기 전에는 `.env` 파일을 로드할 수 없기 때문에, 이 대신 명령을 이용하면 Vite 설정 파일에서 `process.env.NODE_ENV`에 접근할 수 있습니다.
214-
:::
214+
:::

0 commit comments

Comments
 (0)