Skip to content

loadConfig

This content is not available in your language yet.

loadConfig(filePath, env?): Promise<UserConfig>

Defined in: core/src/config-loader.ts:73

config 파일을 로드한다. 확장자에 따라 self-compile 또는 직접 import.

존재 여부는 사전 stat 으로 확인하지 않고 실제 read/import 의 ENOENT 를 catch 한다 — TOCTOU 회피 + 1 syscall 절감.

함수형 config 가 export 됐으면 env 인자를 전달해 호출하고 반환된 객체를 사용한다. env 미제공 시 적절한 기본값 (command: "bundle", mode: "production") 으로 호출.

string

ConfigEnv

Promise<UserConfig>

파일이 없거나, 확장자가 지원되지 않거나, 컴파일/평가가 실패하면 throw.