From 75217d645c73d058defc14e08c65f96dd7c46fcd Mon Sep 17 00:00:00 2001 From: Burlesque1 Date: Thu, 19 Mar 2026 14:53:49 +0800 Subject: [PATCH] fix: skip optional bundled clusters in metadata copy This aligns the filtering logic in copy-bundled-plugin-metadata.mjs with tsdown.config.ts so skip optional bundled clusters that are not included in the current build configuration. This prevents the creation of dist/extensions/*/package.json files that point to non-existent index.js files. --- scripts/copy-bundled-plugin-metadata.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/copy-bundled-plugin-metadata.mjs b/scripts/copy-bundled-plugin-metadata.mjs index 12211f9b29b..ea833bda43b 100644 --- a/scripts/copy-bundled-plugin-metadata.mjs +++ b/scripts/copy-bundled-plugin-metadata.mjs @@ -1,6 +1,7 @@ import fs from "node:fs"; import path from "node:path"; import { pathToFileURL } from "node:url"; +import { shouldBuildBundledCluster } from "./lib/optional-bundled-clusters.mjs"; import { removeFileIfExists, removePathIfExists, @@ -176,6 +177,11 @@ export function copyBundledPluginMetadata(params = {}) { if (!dirent.isDirectory()) { continue; } + // Skip optional bundled clusters that are not included in this build. + // This matches the filtering logic in tsdown.config.ts. + if (!shouldBuildBundledCluster(dirent.name, process.env)) { + continue; + } sourcePluginDirs.add(dirent.name); const pluginDir = path.join(extensionsRoot, dirent.name);