Repository navigation
fix(core): ignore optional hono type imports - #13883
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the @rspack/core prebundle pipeline to prevent TypeScript TS2307 “Cannot find module …” errors caused by optional Hono peer type imports appearing in the generated http-proxy-middleware declaration bundle.
Changes:
- Adds an
afterBundlepost-processing step forhttp-proxy-middlewareto suppress TS errors for optional imports from@hono/node-serverandhonoby injecting// @ts-ignorein the generatedindex.d.ts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
🙈 Size remains the same at 61.85MB |
Rsdoctor Bundle Diff AnalysisFound 6 projects in monorepo, 6 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 popular-libsPath:
📁 react-10kPath:
📁 react-1kPath:
📁 romePath:
📁 react-5kPath:
📁 ui-componentsPath:
Generated by Rsdoctor GitHub Action |
Summary
This PR fixes TypeScript TS2307 errors from the bundled
http-proxy-middlewaretype declarations in@rspack/core. The generatedcompiled/http-proxy-middleware/index.d.tscan import optional Hono peer types from@hono/node-serverandhono, causing projects without those packages installed to fail with missing-module errors such as:The prebundle step now suppresses those optional Hono peer type imports in the generated declaration file. This PR also adds
tests/type-teststo runtsc --noEmitagainst the public@rspack/coreand@rspack/clitype entries under both bundler and NodeNext module resolution, and wires it intotest:ci.Checklist