Skip to content

loadWorkspace

This content is not available in your language yet.

loadWorkspace(filePath, env?): Promise<Workspace>

Defined in: core/src/workspace.ts:140

workspace 파일 로드. loadModuleDefault 가 TS/JS/JSON 디스패치 + (tmp 파일) self-compile 까지 처리하므로 호출자는 단일 진입점만 알면 된다. 함수형 export 면 env (또는 defaultConfigEnv()) 와 호출. 결과는 항상 검증된 entries 배열.

string

workspace 파일 — 절대 또는 cwd 기준 상대 경로

ConfigEnv

함수형 workspace 호출 시 주입할 컨텍스트. 미제공 시 defaultConfigEnv().

Promise<Workspace>

검증된 entries 배열 (순서 유지)

@zntc/core: workspace must export an array (got X) from <path> — top-level 배열 아님

@zntc/core: workspace[i] is empty string in <path> — 빈 문자열 entry

@zntc/core: workspace[i] must be a string or object (got X) in <path> — 잘못된 타입

@zntc/core: workspace[i] inline entry requires non-empty 'name' in <path> — inline 인데 name 없음

const ws = await loadWorkspace("zntc.workspace.ts", { command: "bundle", mode: "production", env: process.env });
// ws: WorkspaceEntry[]