mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-10-31 02:45:40 +00:00
* perf(cli): commands run without esbuild, puppeteer-core or sharp until they need them A host that bundles the CLI can now leave these packages out: each command loads them only where it uses them, and sharp installs once on first use when it is missing. The build check fails on any static import of them again. * fix(cli): use a host's sharp from NODE_PATH and let hosts turn first-use installs off * fix(cli): capture fails when sharp is missing, and one install serves every caller A missing sharp now stops the asset download up front instead of counting every image as unavailable. Concurrent first uses share one install, a failed install is not retried in the same run, and preview thumbnails report why. Hosts can turn off installs for a list of packages, e.g. HYPERFRAMES_NO_OPTIONAL_INSTALL=sharp. * fix(cli): snapshot --describe still works without sharp, resizing only when it is installed * style(cli): format the sharp loader and its tests * build(cli): sharp is an optional dependency, so a host can ship the CLI without it * build(studio-server): keep sharp out of the bundle now that it is optional
37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
import { defineConfig } from "tsup";
|
|
|
|
export default defineConfig({
|
|
entry: {
|
|
index: "src/index.ts",
|
|
"helpers/screenshotClip": "src/helpers/screenshotClip.ts",
|
|
"helpers/mediaCodecMap": "src/helpers/mediaCodecMap.ts",
|
|
"helpers/proxyTranscoder": "src/helpers/proxyTranscoder.ts",
|
|
"helpers/loudness": "src/helpers/loudness.ts",
|
|
"helpers/mediaProxyPreview": "src/helpers/mediaProxyPreview.ts",
|
|
"helpers/manualEditsRenderScript": "src/helpers/manualEditsRenderScript.ts",
|
|
"helpers/studioMotionRenderScript": "src/helpers/studioMotionRenderScript.ts",
|
|
"helpers/draftMarkers": "src/helpers/draftMarkers.ts",
|
|
"helpers/finiteMutation": "src/helpers/finiteMutation.ts",
|
|
"helpers/sourceMutation": "src/helpers/sourceMutation.ts",
|
|
"helpers/safePath": "src/helpers/safePath.ts",
|
|
"helpers/hfIdPersist": "src/helpers/hfIdPersist.ts",
|
|
"helpers/encoderOptions": "src/helpers/encoderOptions.ts",
|
|
"history/index": "src/history/index.ts",
|
|
},
|
|
format: ["esm"],
|
|
outDir: "dist",
|
|
target: "node22",
|
|
platform: "node",
|
|
bundle: true,
|
|
// Split shared chunks so every entry (index + helper subpaths) imports ONE
|
|
// copy of stateful modules — proxyTranscoder's in-flight dedupe, transcode
|
|
// semaphore, and negative cache must be process-global, not per-entry.
|
|
// With splitting off, each entry inlined its own copy and a pre-warm from
|
|
// media-proxy-preview couldn't dedupe against a route's proxy-transcoder.
|
|
splitting: true,
|
|
clean: true,
|
|
dts: true,
|
|
// An optional dependency, so tsup would otherwise inline it.
|
|
external: ["sharp"],
|
|
});
|