fix(scripts): keep watch proof asset copies out of idle window

This commit is contained in:
Vincent Koc
2026-06-02 13:54:42 +02:00
parent cd0af35e5c
commit 4115f0c82f
5 changed files with 99 additions and 7 deletions
+13 -1
View File
@@ -473,10 +473,22 @@ const listRequiredOpenClawExtensionAliasOutputs = (deps) => {
};
const listRequiredStaticExtensionAssetOutputs = (deps) => {
if (deps.env.OPENCLAW_RUNTIME_POSTBUILD_STATIC_ASSETS === "0") {
return [];
}
const distRoot = resolveRuntimePostBuildDistRoot(deps);
const runtimeRoot = resolveRuntimePostBuildRuntimeRoot(deps);
const runtimeExtensionsRoot = path.join(runtimeRoot, "extensions");
const hasRuntimeOverlay = deps.fs.existsSync(runtimeExtensionsRoot);
return discoverStaticExtensionAssets({ rootDir: deps.cwd, fs: deps.fs })
.filter((asset) => deps.fs.existsSync(path.join(deps.cwd, asset.src)))
.map((asset) => path.join(distRoot, normalizePath(asset.dest).replace(/^dist\//u, "")))
.flatMap((asset) => {
const relativeOutput = normalizePath(asset.dest).replace(/^dist\//u, "");
return [
path.join(distRoot, relativeOutput),
...(hasRuntimeOverlay ? [path.join(runtimeRoot, relativeOutput)] : []),
];
})
.toSorted((left, right) => left.localeCompare(right));
};