-
-
Notifications
You must be signed in to change notification settings - Fork 760
fix: update lazy compilation middleware order to apply devServer Middleware #11157
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
✅ Deploy Preview for rspack canceled.
|
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 fixes CORS issues in the lazy compilation middleware by adding necessary Access-Control headers to match webpack's lazy compilation backend implementation.
- Consolidates header setting into a single
writeHeadcall with CORS headers - Adds
Access-Control-Allow-Origin,Access-Control-Allow-Methods, andAccess-Control-Allow-Headersheaders with wildcard values
packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts
Outdated
Show resolved
Hide resolved
packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts
Outdated
Show resolved
Hide resolved
packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts
Outdated
Show resolved
Hide resolved
📦 Binary Size-limit
🙈 Size remains the same at 50.32MB |
packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts
Outdated
Show resolved
Hide resolved
|
It's not safe to use cors: '*', it's strange that dev server should already set cors headers as expected, is that lazy compile middleware run before that 🤔 |
CodSpeed Performance ReportMerging #11157 will not alter performanceComparing 🎉 Hooray!
|
ae1e062 to
2d7e0a9
Compare
2d7e0a9 to
19f5d6f
Compare
Summary
Lazy compilation middleware should apply devServer headers configuration to support user set
Access-Control-Allow-Origin,Access-Control-Allow-Methods,Access-Control-Allow-Headersheaders to avoid tigger CORS.Related links
fix: #10044
Checklist