refactor: bundle http-proxy-middleware#180
Merged
chenjiahan merged 2 commits intomainfrom Apr 1, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the server build/package setup so http-proxy-middleware is bundled into the server output (rather than treated as a runtime external), while adjusting the internal proxy middleware typing to stay compatible with the lazy-loaded middleware and WebSocket upgrade handling.
Changes:
- Bundle
http-proxy-middlewareby removing it from server externals and moving it fromdependenciestodevDependencies. - Switch proxy loading from
require('http-proxy-middleware')to a lazyawait import('http-proxy-middleware')to align with bundling/code-splitting. - Narrow internal proxy middleware types to
connect-next’sNextHandleFunctionand adjust related casts for the websocket-upgrade path.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/types.ts |
Stops importing/re-exporting http-proxy-middleware’s RequestHandler type from the shared internal types module. |
src/server.ts |
Lazily imports http-proxy-middleware and updates internal proxy/websocket proxy typing to NextHandleFunction. |
rslib.config.ts |
Removes http-proxy-middleware from the server bundle externals so it will be bundled. |
package.json |
Moves http-proxy-middleware from dependencies to devDependencies to reflect bundling. |
pnpm-lock.yaml |
Lockfile update reflecting the dependency move. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR bundles
http-proxy-middlewareinto the server build instead of treating it as a runtime external. It also narrows the internal proxy middleware typing so the lazy-loaded middleware and websocket upgrade path stay compatible after bundling.