@hyperfrontend/builder/bundle/dependencies/workerworker
Forked-worker entry script for the dependency pre-pass. Sits behind the runPrePass orchestrator in bundle/dependencies/pre-pass.ts.
The worker reads a serializable PrePassWorkerJob from process.argv[2] and reconstructs RollupOptions for one of four kinds: the npm JS pre-pass (json + nodeResolve + commonjs), the npm d.ts pre-pass (rollup-plugin-dts), the workspace-source JS pre-pass (the same JS chain plus @rollup/plugin-typescript driving the dep's tsconfig), or the workspace-source d.ts pre-pass (rollup-plugin-dts driven by that tsconfig). It then runs rollup() → bundle.write() → bundle.close(), writes a JSON report to job.reportPath, and exits. Process isolation reclaims the rollup-invocation heap and RSS at exit so each dep is pre-passed in a fresh address space, keeping the parent bounded across the full dep set.
runPrePassWorkerJob(job) is exported so callers and tests can drive the worker logic without spawning a new Node process.
API Reference
ƒ Functions
job and writes the resulting report to job.reportPath. Public so callers (and tests) can drive the worker logic without spawning a new Node process.
Parameters
| Name | Type | Description |
|---|---|---|
§job | PrePassWorkerJob | Job spec describing the rollup invocation. |
Returns
Promise<PrePassWorkerReport>Example
Driving the worker logic in-process for a fixture
const report = await runPrePassWorkerJob({ kind: 'js', dep: 'rollup', ... })◈ Interfaces
process.argv[2]. Each invocation produces exactly one rollup output and one JSON report at
reportPath so the parent orchestrator can collect per-job statistics.Properties
depsRoot?:string— _dependencies/ root. Required when npmDeps or workspaceRoutes is non-empty.format:"cjs" | "esm"— 'esm' or 'cjs'. dts jobs always use 'es' internally.inputPath:string— .ts for workspace-*).kind:PrePassWorkerJobKind— js and dts run the npm-dep pipeline; workspace-js and workspace-dts add @rollup/plugin-typescript (or rollup-plugin-dts's tsconfig integration) so TypeScript source workspace deps can be hoisted.npmDeps?:string[]— otherDeps:string[]— otherWorkspaceSpecifiers?:string[]— @hyperfrontend/immutable-api-utils/built-in-copy/array). Used by workspace-* jobs so sibling sub-paths externalize cleanly without also externalizing every other sub-path on the same package.selfDtsPath?:string— selfSrcPath?:string— srcPath (used for diagnostics). Empty string for the package root.siblingEntries?:SiblingEntry[]— dts pass to externalize imports that resolve into another entry's directory. Empty / omitted for dep pre-pass jobs.workspaceRoot?:string— baseUrl for path-mapping resolution (workspace-* jobs only).workspaceRoutes?:WorkspaceBundledDepRoute[]— workspace-js / workspace-dts) this excludes the specifier or package being built so the chunk inlines its own internals.reportPath when a worker exits cleanly.