loadWorkspace
loadWorkspace(
filePath,env?):Promise<Workspace>
Defined in: core/src/workspace.ts:140
workspace 파일 로드. loadModuleDefault 가 TS/JS/JSON 디스패치 + (tmp 파일) self-compile
까지 처리하므로 호출자는 단일 진입점만 알면 된다. 함수형 export 면 env (또는
defaultConfigEnv()) 와 호출. 결과는 항상 검증된 entries 배열.
Parameters
섹션 제목: “Parameters”filePath
섹션 제목: “filePath”string
workspace 파일 — 절대 또는 cwd 기준 상대 경로
env?
섹션 제목: “env?”함수형 workspace 호출 시 주입할 컨텍스트. 미제공 시 defaultConfigEnv().
Returns
섹션 제목: “Returns”Promise<Workspace>
검증된 entries 배열 (순서 유지)
Throws
섹션 제목: “Throws”@zntc/core: workspace must export an array (got X) from <path> — top-level 배열 아님
Throws
섹션 제목: “Throws”@zntc/core: workspace[i] is empty string in <path> — 빈 문자열 entry
Throws
섹션 제목: “Throws”@zntc/core: workspace[i] must be a string or object (got X) in <path> — 잘못된 타입
Throws
섹션 제목: “Throws”@zntc/core: workspace[i] inline entry requires non-empty 'name' in <path> — inline 인데 name 없음
Example
섹션 제목: “Example”const ws = await loadWorkspace("zntc.workspace.ts", { command: "bundle", mode: "production", env: process.env });// ws: WorkspaceEntry[]