-
Notifications
You must be signed in to change notification settings - Fork 6
feat: port webpack-dev-server #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR ports the core functionality from webpack-dev-server@5 to @rspack/dev-server to provide feature parity for Rspack users. The implementation includes:
Changes:
- Removed dependency on webpack-dev-server and implemented core server functionality directly
- Added comprehensive server implementations (WebSocket, SockJS) with base abstractions
- Ported client-side modules for HMR, overlay, progress indicators, and WebSocket communication
- Added build infrastructure for client modules bundling
- Updated configuration schema and type definitions
Reviewed changes
Copilot reviewed 41 out of 45 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/server.ts | Complete rewrite implementing dev server from scratch |
| src/servers/*.ts | New WebSocket server implementations (BaseServer, WebsocketServer, SockJSServer) |
| src/getPort.ts | New port allocation utility |
| src/patch.ts | Removed (no longer needed with native implementation) |
| src/index.ts | Updated to export new Server class |
| src/options.json | New comprehensive dev server options schema |
| client-src/*.ts | New client-side modules for HMR and dev server communication |
| scripts/build-client-modules.cjs | New build script for client module bundling |
| tsconfig*.json | Updated TypeScript configurations |
| package.json | Updated dependencies and exports |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chenjiahan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we update the credits to clarify that this project is forked from webpack-dev-server?
https://github.com/rstackjs/rspack-dev-server?tab=readme-ov-file#credits
Done |
Summary
This PR ports the core functionality from
webpack-dev-server@5to@rspack/dev-serverto provide a comprehensive development server experience for Rspack users. The porting effort includes:This change enables
@rspack/dev-serverto offer feature parity withwebpack-dev-server, allowing developers to seamlessly migrate from webpack to Rspack while maintaining the same development experience. The implementation follows the same architecture and patterns as webpack-dev-server, ensuring compatibility and familiarity for existing users.Checklist