From f6b6edee232ef9f3c2fa306a53f2ee527da1d6f3 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 24 Apr 2026 20:35:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(deps):=20=E8=A1=A5=E4=B8=81=E7=BB=95?= =?UTF-8?q?=E8=BF=87=20@tanstack/start-plugin-core=20=E8=AF=AF=E5=BC=95=20?= =?UTF-8?q?@rsbuild/core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tanstack/start-plugin-core@1.168.0 的 dist/esm/index.js 在 Vite 场景 下也会静态导入 ./rsbuild/planning.js,而后者硬依赖被标为 optional peer 的 @rsbuild/core,导致 vite build 启动阶段 ERR_MODULE_NOT_FOUND。 引入 bun patch 只保留 vite 相关导出(删掉 RSBUILD_ENVIRONMENT_NAMES 和 tanStackStartRsbuild),不安装 rsbuild 全家桶(rspack 很重)。 等上游修复再移除本补丁。 --- bun.lock | 3 +++ package.json | 3 +++ patches/@tanstack%2Fstart-plugin-core@1.168.0.patch | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 patches/@tanstack%2Fstart-plugin-core@1.168.0.patch diff --git a/bun.lock b/bun.lock index c2a0966..fa95b6e 100644 --- a/bun.lock +++ b/bun.lock @@ -42,6 +42,9 @@ }, }, }, + "patchedDependencies": { + "@tanstack/start-plugin-core@1.168.0": "patches/@tanstack%2Fstart-plugin-core@1.168.0.patch", + }, "packages": { "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], diff --git a/package.json b/package.json index 1fe5d13..b4dd035 100644 --- a/package.json +++ b/package.json @@ -58,5 +58,8 @@ "tailwindcss": "^4.2.4", "typescript": "^6.0.3", "vite": "^8.0.10" + }, + "patchedDependencies": { + "@tanstack/start-plugin-core@1.168.0": "patches/@tanstack%2Fstart-plugin-core@1.168.0.patch" } } diff --git a/patches/@tanstack%2Fstart-plugin-core@1.168.0.patch b/patches/@tanstack%2Fstart-plugin-core@1.168.0.patch new file mode 100644 index 0000000..b01d0ae --- /dev/null +++ b/patches/@tanstack%2Fstart-plugin-core@1.168.0.patch @@ -0,0 +1,12 @@ +diff --git a/dist/esm/index.js b/dist/esm/index.js +index 5a5e23586d76ffac58ca95cafa46759d39be68d0..32db5e8d38c11bb430326ed6c1b4fd9a944b49f2 100644 +--- a/dist/esm/index.js ++++ b/dist/esm/index.js +@@ -1,6 +1,4 @@ + import { START_ENVIRONMENT_NAMES, VITE_ENVIRONMENT_NAMES } from "./constants.js"; + import { createVirtualModule } from "./vite/createVirtualModule.js"; + import { tanStackStartVite } from "./vite/plugin.js"; +-import { RSBUILD_ENVIRONMENT_NAMES } from "./rsbuild/planning.js"; +-import { tanStackStartRsbuild } from "./rsbuild/plugin.js"; +-export { RSBUILD_ENVIRONMENT_NAMES, START_ENVIRONMENT_NAMES, VITE_ENVIRONMENT_NAMES, createVirtualModule, tanStackStartRsbuild, tanStackStartVite }; ++export { START_ENVIRONMENT_NAMES, VITE_ENVIRONMENT_NAMES, createVirtualModule, tanStackStartVite };